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]

Reducing static binary size


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


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