This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [ecj] Abort if we are ABI-incompatible
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 23 Nov 2006 16:12:14 +0000
- Subject: Re: [ecj] Abort if we are ABI-incompatible
- References: <17765.50210.416030.744577@zebedee.pink>
At the moment, if we have a linkage error caused by an incompatible
ABI version we just segfault at some random place rather than
displaying an error message. This is a Bad Thing.
Andrew.
2006-11-23 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Abort if we
are ABI-incompatible.
Index: java/lang/natClassLoader.cc
===================================================================
--- java/lang/natClassLoader.cc (revision 119120)
+++ java/lang/natClassLoader.cc (working copy)
@@ -196,6 +196,12 @@
if (_Jv_CheckABIVersion ((unsigned long) klass->next_or_version))
(*_Jv_RegisterClassHook) (klass);
+ else
+ {
+ fprintf (stderr, "ABI mismatch: library is compiled with "
+ "the wrong version of gcj\n");
+ abort ();
+ }
}
}