lua-users home
lua-l archive

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


> Just a small correction, for the records: Lua never *calls* 'dlopen' by
> itself. In particular, 'luaL_openlibs' does not call 'dlopen'. Lua
> only calls 'dlopen' if the script calls 'require' (and 'require' finds
> an appropriate file in the C path) or if the script calls
'> package.loadlib'. (Of course, that does not elliminate the fact that
> Lua has to be linked to the dlopen library with -ldl, therefore
> causing the problems you are relating.)

Interesting...

Does this mean that "in theory" I can ignore the linker warning, because,
given I load only the standard libraries (and some pure Lua modules),
`dlopen` will never actually be invoked? That would be scary even if it
works...

Alternatively, I could replace `-ldl` with providing my own `dlopen`, which
would `assert` that it shouldn't have been called, indicating that`require`
is trying to load a strange C module, and kill the program (acceptable in
this scenario). Presumably that would fix the linker error and be "safe".
Does this workaround make sense?

Thanks,

Oren.



--
View this message in context: http://lua.2524044.n2.nabble.com/Statically-linked-executables-tp7678758p7678761.html
Sent from the Lua-l mailing list archive at Nabble.com.