gcj on OSF1 DUX V4.0B
Andrew Haley
aph@cambridge.redhat.com
Fri Feb 15 11:02:00 GMT 2002
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.
More information about the Java
mailing list