This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
gcj on OSF1 DUX V4.0B
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: Philip Goisman <goisman at physics dot arizona dot edu>
- Cc: java-discuss at sources dot redhat dot com, goisman at m5 dot physics dot arizona dot edu
- Date: Fri, 15 Feb 2002 18:10:58 +0000 (GMT)
- Subject: gcj on OSF1 DUX V4.0B
- References: <200202151655.g1FGtAM61572@m5.physics.arizona.edu>
Philip Goisman writes:
> Hi,
>
> I compiled and installed gnu java with the
> following:
>
> ../configure --enable-version-specific-runtime-libs \
> --enable-languages=c,c++,f77,java --enable-libgcj --with-stabs
>
> gcj --main=HelloWorld --encoding=UTF-8 -o HelloWorld HelloWorld.java -static
>
> from which I get a lot of on-screen messages as follow:
>
> /bin/ld:
> /usr/local/lib/gcc-lib/alphaev5-dec-osf4.0b/3.0.3/../../../libgcj.a(natObject.o): _Jv_GetArrayElementFromElementType(java::lang::Object*, java::lang::Class*): weak symbol multiply defined
> /usr/local/lib/gcc-lib/alphaev5-dec-osf4.0b/3.0.3/../../../libgcj.a(jni.o): _Jv_GetArrayElementFromElementType(java::lang::Object*, java::lang::Class*): weak symbol multiply defined
>
>
> and a very large HelloWorld (9838592 Feb 15 09:48 HelloWorld)
>
> But, when I run it works?
>
> ./HelloWorld
> Hello World!
>
> Please explain why it works versus the original suggested command,
Because the linker you're trying to use isn't much good. If GNU
binutils are available on your platform I suggest you use those.
> why the size is so large,
because you've statically linked with the entire libgcj.
> and is there a way to fix it so the compiled code isn't as large (a
> reasonable size for HelloWorld - ~30000) and the compile command
> more inline with that suggested?
If GNU binutils works on your platform, try that and see how you get
on.
Andrew.