lua-users home
lua-l archive

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


On Sat, Mar 5, 2011 at 2:10 AM, Vasiliy G Tolstov wrote:

> I'm try to static link lua with my app
>
> Linking brings warning. How can I avoid this and what it mean for me if
> i want to build fully static binary, that can be running inside initrd
> with no libraries?

> warning: Using 'dlopen' in statically linked applications requires at
> runtime the shared libraries from the glibc version used for linking


Does your application need to load any C modules at runtime?
If not, maybe you could build your own Lua lib without it.

Something like this:

cd /path/to/lua-5.1.4/src

make clean ansi CFLAGS='-ULUA_DL_DLOPEN'

cd /path/to/your/app

cc -std=c99 -O0 -ggdb -static  -static-libgcc -o embed embed.c \
-I/usr/include/lua5.1 -L/usr/lib64  /path/to/lua-5.1.4/src/liblua.a -lm -lc

(Note that I removed -llua5.1 and -ldl from the compiler command)

 - Jeff