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]

gcj on OSF1 DUX V4.0B


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

make bootstrap

make install

All appears fine until I try the test of HelloWorld which is recommended.

Then I get the following results:

gcj --main=HelloWorld -o HelloWorld HelloWorld.java

HelloWorld.java:0: unknown encoding: `ISO8859-1'
   This might mean that your locale's encoding is not supported
   by your system's iconv(3) implementation.  If you aren't trying
   to use a particular encoding for your input file, try the
   `--encoding=UTF-8' option.
compilation terminated.

no results, so next I try

gcj --main=HelloWorld --encoding=UTF-8 -o HelloWorld HelloWorld.java

This time I get a compiled HelloWorld with size of 
49152 Feb 15 09:45 HelloWorld*

But when I run I get

./HelloWorld
14186:./HelloWorld: /sbin/loader: Fatal Error: lazy_text_resolve: 
symbol free should not have any relocation entry

So, I delete the executable and retry with:

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
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0b/3.0.3/../../../libgcj.a(natSystem.o): _Jv_GetArrayElementFromElementType(java::lang::Object*, java::lang::Class*): weak symbol multiply defined
/bin/ld:
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0b/3.0.3/../../../libgcj.a(natObject.o): _Z34_Jv_GetArrayElementFromElementTypePN4java4lang6ObjectEPNS0_5ClassE: weak symbol multiply defined
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0b/3.0.3/../../../libgcj.a(jni.o): _Z34_Jv_GetArrayElementFromElementTypePN4java4lang6ObjectEPNS0_5ClassE: weak symbol multiply defined
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0b/3.0.3/../../../libgcj.a(natSystem.o): _Z34_Jv_GetArrayElementFromElementTypePN4java4lang6ObjectEPNS0_5ClassE: 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, why
the size is so large, 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?

Regards,

	Philip


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