lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I totally agree when you say RTLD_GLOBAL should not be added as default flags, especially for C libraries.

However, the fact that a program behaves differently from one platform to another one with a C++ library is wrong in my opinion: it works under Windows, but not with gcc.

Even if I adapt Lua for my own needs (which I do), all Linux distributions come with their own Lua package with this problem.

I did not propose any fix to this problem, and in fact I do not have any idea to correct it nicely. I am only saying RTLD_GLOBAL should be used for C++ libraries dependent on RTTI. Being able to pass some specific flags to dlopen() from Lua (as python does) would be a possibility as it has been already suggested on this list a while ago, but the flags are not portable (e.g. different for Windows which does not even use dlopen()).

Maybe having a way to say to "require()" we want to advertise everything in the shared library would be a solution. Or maybe having a loadclib() and loadcpplib() function. Or maybe saying in "require()" documentation that it does not support fully C++...