tech-userlevel archive

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

Lua and dlopen(3)

Hi all,

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/

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/'' 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?


Home | Main Index | Thread Index | Old Index