This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

semi-static linux binary


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]