Binary size of statically linked java application
Marco Trudel
mtrudel@gmx.ch
Tue Nov 28 18:22:00 GMT 2006
David Daney wrote:
> <snip>
>> Libgcj-3.4.3 is running embedded on mipsel-linux on several hundred
> thousand HD television sets.
Wow, cool!
> If you are interested in the patches we
> did to trim down libgcj for that, let me know. The basic technique is
> to statically link and then look at the linker map to see if there are
> things included that you think should be unneeded. If so, modify the
> libgcj source so that they are no longer referenced.
That's pretty much the same as my approach with the difference that in
my approach, GCJ doesn't have to be recompiled after every change and
libgcj.a can be reused in the original state.
That's because after having completely created a stub, the original
libgcj.a can be used again. As soon as the stub is linked into the the
binary, the objects from the archive won't be pulled in any more
(because the depencies are already satisfied).
So I usually remove all objects with e.g. GUI classes, create a binary
with all remaining objects (without libgcj.a of course) and resolve all
depencies. This way, all depencies for the GUI classes will always be
satisfied when using the stub. No matter what the source is...
Marco
More information about the Java
mailing list