[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: static linking with lua
- From: Vasiliy G Tolstov <v.tolstov@...>
- Date: Sat, 05 Mar 2011 11:53:50 +0300
On Sat, 2011-03-05 at 02:48 -0600, Jeff Pohlmeyer wrote:
> 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
Thank You. But if my application can load shared libraries static
linking is not allowed?
Vasiliy G Tolstov <firstname.lastname@example.org>