semi-static linux binary
Bart Locanthi
bart@sabl.com
Thu Oct 23 17:16:00 GMT 2003
So how big does this make the binary?
And will this work for the various Class.forName() usages we do in Java?
Geoff Strom wrote:
>Here's what works for me to produce a semi-static binary under linux (using gcc 3.3.1):
>>1) hide libgcj.so.4.0.0 by renaming it.
>2) export LD_LIBRARY_PATH=.
>3) use -static-libgcc when linking your binary (don't use -static)
>>Running ldd on the resulting binary produces the following (redhat 8):
>>libm.so.6 => /lib/i686/libm.so.6 (0x40027000)
>libpthread.so.0 => /lib/i686/libpthread.so.0 (0x4004a000)
>libdl.so.2 => /lib/libdl.so.2 (0x4009a000)
>libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>I then transferred the binary to another machine running redhat 9 (without gcc 3.3.1) and it ran fine.
>>-Geoff
>>>>
More information about the Java
mailing list