Closed gudzpoz closed 1 year ago
Unfortunately, this breaks our current tests, since we do use multiple versions of Lua in our tests. I'm going to make this behavior optional.
No, I don't think I will be ever able to test this. Considering I am going to test this against:
Currently Lua scripts won't be able to load external binary libraries on platforms with
dlopen
. This is probably because the library itself is open with theRTLD_LOCAL
flag.As is illustrated in the diagram,
lfs.so
is actually expecting to see symbols from the Lua libraryliblua**.so
. However, JVM initially opened the library withRTLD_LOCAL
, making the library symbols only visible to the JVM, so loadinglfs.so
will fail.A workaround is just to re-open the library with the
RTLD_GLOBAL
flag.This might bring another problem: it pollutes the global symbol space. Consider running Lua 5.1 and Lua JIT at the same time, there is just no way to distinguish between their symbols. (I have no idea if the current implementation works under this situation through.) But certainly you will not be able to load
lfs.so
from multiple versions of Lua.RTLD_GLOBAL
dlopen
platforms)fixes #94