Reducing static binary size
Geert Bevin
gbevin@uwyn.com
Tue Feb 19 03:10:00 GMT 2002
Hello,
I'm evaluating to use gcj for an opensource project instead of plain old
c. The merits would be that development in java is much cleaner, offers
faster development and better supports OO. It's however required to be
able to provide a statically linked binary that doesn't rely on
anything. This mainly for system rescue purposes. When trying out gcj
3.0.3 and compiling HelloWorld.java like this :
gcj -static --main=HelloWorld -o HelloWorld HelloWorld.java
I get an executable of 5752548 bytes, stripping that gets it down to
2064192 bytes. Surely this contains a huge lot of dead code for
something as simple as printing one string to the standard output.
It there a way to reduce the size of the generated binary even further,
or does someone have any ideas about how to look into that?
Thanks for the help,
Geert Bevin
--
Geert Bevin Uwyn
"Use what you need" Lambermontlaan 148
http://www.uwyn.com 1030 Brussels
gbevin@uwyn.com Tel & Fax +32 2 245 41 06
More information about the Java
mailing list