GCJ adoption and improving our "PR"
Wed Apr 14 21:33:00 GMT 2004
Erik Poupaert wrote:
>$ gcj -static Hello.java -o hello --main=Hello
>$ ls -lh hello
>-rwxr-xr-x 1 erik users 4.2M Apr 14 20:19 hello
>That is: 4,376,645 bytes.
>That is: 4,274 KB.
>That is: 4.2 MB.
>It used to be better, I remember.
>By the way, I've been treated to a whole new series of warnings en provenance from
>the linker underworld:
>function `GC_dlopen':: warning: Using 'dlopen' in statically linked applications
>requires at runtime the shared libraries from the glibc version used for
>In function `java::lang::Runtime::insertSystemProperties(java::util::Properties*)'::
>warning: Using 'getpwuid_r' in statically linked applications requires at runtime the
>shared libraries from the glibc version used for
I suggest linking glibc and others dynamically. Just link libgcj
statically. glibc's ABI is stable enough these days that static linking
just causes more problems than it solves. Your binary will be smaller too.
>Funny, isn't it? "Hello world" is dragging around -- kicking and screaming -- entire
>excerpts from java.net.InetAddress with related dependencies.
Such is the nature of Java - it does not lend itself easily to static
compilation. But there are ways to improve the situation.
More information about the Java