This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [3.0 branch] libjava testsuite, i686-pc-linux-gnu --disable-shared
Andrew Haley wrote:
> This problem is caused by initialization in libgcj: class
> initialization routines are being called before the C++ static
> initializers that they depend on have been run.
>
> This patch removes the dependence on static initializers. It is
> mostly the same as one posted by Bryce a couple of months ago.
>
> In practice it is almost impossible to control C++ static
> initializers, so I propose that we ban them from now on.
Agreed.
> + finit_leg_name = _Jv_makeUtf8Const ("$finit$", 6);
I think we can remove this?
> RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
> retrieving revision 1.32
> diff -p -2 -c -r1.32 natClassLoader.cc
> *** natClassLoader.cc 2001/04/28 01:39:15 1.32
> --- natClassLoader.cc 2001/05/03 15:23:32
> *************** void
> *** 424,438 ****
> _Jv_RegisterClasses (jclass *classes)
> {
> ! static bool init = false;
> !
> ! if (! init)
> ! {
> ! init = true;
> ! _Jv_InitThreads ();
> ! _Jv_InitGC ();
> ! _Jv_InitializeSyncMutex ();
> ! }
> !
> ! JvSynchronize sync (&ClassClass);
> for (; *classes; ++classes)
> {
> --- 424,429 ----
> _Jv_RegisterClasses (jclass *classes)
> {
> ! // FIXME
> ! //JvSynchronize sync (&ClassClass);
> for (; *classes; ++classes)
> {
_Jv_RegisterClasses needs to be made thread-safe before we can check it in (thats
the reason for the FIXME).
regards
[ bryce ]