Lua and dlopen(3)
Christian Koch <cfkoch <at> sdf.lonestar.org>
2014-02-20 03:53:18 GMT
I've been playing with Lua quite a bit these days, especially building
extensions to it. Sometimes, however, I encounter an error like this:
Cannot dlopen non-loadable /usr/lib/libpthread.so.1
After a bit of research, I found that it is actually the interpreter's fault.
From the man page dlfcn(3):
The error ``cannot dlopen non-loadable /usr/lib/libpthread.so.1'' is
generated when a program dlopen()s a module that needs libpthread but
isn't linked against it itself.
As expected, my Lua extensions actually work if I load them with my own custom
build of Lua linked against libpthread.
Furthermore, Lua from pkgsrc isn't linked against libpthread either.
I think it makes sense to provide Lua built this way. I would just complain to
the pkgsrc folks, but since Lua comes with the system, I don't know if it's best
to fix this here, or at pkgsrc, or both. Or maybe dlopen(3) itself needs to be
Since this problem affects other packages (e.g. databases/lua-tokyocabinet), I
guess I should report something to the pkgsrc list, regardless?