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]

Re: statically linked executable size


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Haley wrote:
> Ranjit Mathew writes:
>  > 
>  > There are so many classes whose presence in the executable is
>  > something that I cannot readily account for - for example, why
>  > is javax.swing.JToolBar needed to print "Hello World" on the
>  > console?
> 
> This one comes up every once in a while, and there's a technique for
> finding out.
> 
>  $ gcj -static Hello.java --main=Hello -Wl,-Map,Hello.map

Thanks. I don't know why I didn't remember to use this.

What seems to happen is that we have java.lang.SecurityManager
that directly uses java.awt.AWTPermission. This means that the
object file for the *entire* java.awt package gets pulled in,
since we compile a package at a time, which leads to a whole
lot of new references that need to be satisfied and so on
ad nauseum.

Now I can see how JToolBar gets pulled in.

Thanks,
Ranjit.

- --
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://rmathew.com/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEqPU3Yb1hx2wRS48RArfvAJ0dvnlt7avxCfRD7GyXkygEo5c+iQCggHZm
IQ0D7S7E6qmXVSUUHSERZhE=
=f+14
-----END PGP SIGNATURE-----


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