[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Statically linked executables
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 27 Jun 2017 16:13:56 -0300
> [...]
>
> Simply adding `-static` in the linking flags, together with `-llua` and
> `-lm` doesn't work, since `luaL_openlibs()` calls `dlopen`...
>
> [...]
>
> The question is, instead, how do I avoid the call of `dlopen` in the first
> place?
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.)
-- Roberto