This is the mail archive of the java-patches@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]

patch for "bootstrap problem on x86-linux (and presumably everywhere else)"


Geoff Keating wrote:

> The bootstrap is failing on x86-linux because the symbol
> __gxx_personality_v0 is not defined while linking jv-convert.
>
> I believe this is because libgcj contains C++ code (for instance,
> shs.cc) but does not link with libstdc++.
>
> Is there some reason why this shouldn't be done?

The consensus the last time this came up was that we don't want to
link libstdc++. Its probibly a good thing if only to ensure that we
arn't using C++ exceptions unintentionally in places.

In any case, the problem seems to be that the compiler has started
putting references to the personality functions in more places, and
there were some bits in libjava which hadn't picked up a #pragma
java_exceptions. The patch below fixes this by moving the pragma
declaration to javaprims.h where it is pretty much guaranteed to be
picked up by everything, since this is included by java/lang/Object.h
and gcj/cni.h.

I'm checking this in to the trunk and branch.

regards

  [ bryce ]

2001-05-18  Bryce McKinlay  <bryce@albatross.co.nz>

	* include/jvm.h: Move "#pragma GCC java_exceptions" to ...
	* gcj/javaprims.h: ... here.
	* gnu/gcj/io/shs.cc: Add "#pragma GCC java_exceptions".

Index: include/jvm.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/jvm.h,v
retrieving revision 1.33
diff -u -r1.33 jvm.h
--- jvm.h	2001/05/13 01:28:18	1.33
+++ jvm.h	2001/05/18 05:38:31
@@ -11,9 +11,6 @@
 #ifndef __JAVA_JVM_H__
 #define __JAVA_JVM_H__
 
-// Force C++ compiler to use Java-style exceptions.
-#pragma GCC java_exceptions
-
 #include <gcj/javaprims.h>
 
 #include <java-assert.h>
Index: gcj/javaprims.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gcj/javaprims.h,v
retrieving revision 1.18
diff -u -r1.18 javaprims.h
--- javaprims.h	2001/04/25 15:45:15	1.18
+++ javaprims.h	2001/05/18 05:38:31
@@ -11,6 +11,9 @@
 #ifndef __JAVAPRIMS_H__
 #define __JAVAPRIMS_H__
 
+// Force C++ compiler to use Java-style exceptions.
+#pragma GCC java_exceptions
+
 // FIXME: this is a hack until we get a proper gcjh.
 // It is needed to work around system header files that define TRUE
 // and FALSE.
Index: gnu/gcj/io/shs.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/io/shs.cc,v
retrieving revision 1.1
diff -u -r1.1 shs.cc
--- shs.cc	2000/05/19 17:55:27	1.1
+++ shs.cc	2001/05/18 05:38:31
@@ -10,6 +10,10 @@
  * Comments to pgut1@cs.aukuni.ac.nz
  */
 
+// Force C++ compiler to use Java-style EH, so we don't have to link with
+// libstdc++.
+#pragma GCC java_exceptions
+
 #include <string.h>
 #include "shs.h"
 

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