Hi,
I was testing our modules for Lua 5.2 in MacOSX and notice a strange
behavior on dlopen.
Some of our modules use functions in C of other modules. For instance
luaglu uses C functions from luagl. In MacOSX we cannot link the luaglu.so
against luagl.so, only if it was luagl.dylib. No problem, you require the
luagl module first, then the luaglu module, and the loader will find
everything. This works just fine in Lua 5.1.
In Lua 5.2, the require of the secondary module fail, only in MacOSX
(tested on 10.6 and 10.7).
Inspecting the code, I changed the following line:
void *lib = dlopen(path, RTLD_NOW | (seeglb ? RTLD_GLOBAL : RTLD_LOCAL));
to (the same as it was in Lua 5.1):
void *lib = dlopen(path, RTLD_NOW);
Then it works.
Maybe I need some extra parameter when linking. Anyone have any idea
what's going on?
Thanks,
Scuri