This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: installation problem
- To: Chris Dornan <cdornan at arm dot com>
- Subject: Re: installation problem
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 13 Apr 2000 08:55:08 +1200
- CC: java-discuss at sourceware dot cygnus dot com
- References: <200004121432.PAA00808@sun14.cambridge.arm.com>
Chris Dornan wrote:
> OK, I tried compiling with -O, but no success. I have appended the stack backtrace. (Sorry about its ommision last time.)
>
> Chris Dornan
> cdornan@arm.com
>
> #0 _Jv_equalUtf8Consts (a=0x0, b=0xff2d436a)
> at ../../../libgcj-2.95.1/libjava/prims.cc:89
> #1 0xff2a6c24 in _Jv_GetMethodLocal (klass=0xff31f754, name=0x0,
> signature=0x0) at ../../../libgcj-2.95.1/libjava/java/lang/natClass.cc:527
This is a common problem on Solaris. It is caused by libtool, which doesn't support C++ static initializers on Solaris unless
a) you are using the GNU linker, and b) you manage to convince libtool that you are in fact using the GNU linker (this is the
hard part!).
Looking at natClass.cc, you will see that init_name is a constant that is initialized at runtime by calling
_Jv_makeUtf8Const(). The class initialization process calls _Jv_GetMethodLocal against the value of init_class in order to
find the special initialization method, but if you encounter this bug, init_class is still NULL because the C++ initializer
for Class has not been run (the stack trace is different in libgcj 2.95.1, but the bug is essentially still the same).
You can try to beat libtool into submission - take a look at http://sourceware.cygnus.com/java/build-snapshot.html,
particularly the part about using "--with-gnu-ld". There has been plenty of discussion about this on the list before, try
searching the list archive for "solaris libtool" or something similar.
Possible fixes to this problem in libgcj:
1. fix libtool
2. eliminate the use of C++ static initializers in libgcj (ie by inserting a special initialization function called from
main()). This will make the code uglier, but at least it will work and be a fairly simple fix.
3. don't use libtool (at least until it gets fixed), link libgcj with "gcc -shared". This probibly isn't as evil as it
sounds, because I would guess that any platform that doesn't support "gcc -shared" doesn't work due to the "libtool -vs- C++"
problems anyway.
regards
[ bryce ]