This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PATCH: Fix Solaris 2/x86 signal handling in libgcj
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 24 Feb 2010 15:28:26 +0100
- Subject: PATCH: Fix Solaris 2/x86 signal handling in libgcj
While investigating the remaining Solaris 11/x86 testsuite failures, I
found two causes for the remaining failures, where patches have already
been posted:
PATCH: Properly mark 64-bit .eh_frame section on x86 as type unwind
http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00991.html
PATCH: Fix Solaris 11/x86 MD_FALLBACK_FRAME_STATE_FOR
http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00994.html
Even after those, a problem remained: configure.ac didn't define any
SIGNAL_HANDLER for the platform, unlike Solaris 2/SPARC, which obviously
isn't right. In fact, the code currently in include/sparc-signal.h is
in no way SPARC specific and works on x86 just as well. It isn't even
Solaris specific at all, and should work on any POSIX system. Many of
the other *-signal.h files are very similar, and could probably be
merged into a single posix-signal.h to avoid much unnecessary
duplication. Anyway, I've just renamed the file to solaris-signal.h for
the moment, and set can_unwind_signal=yes just as on Solaris 2/SPARC.
With the two patches above and this one, the libjava testsuite is
completely clean now on i386-pc-solaris2.11 (both 32 and 64-bit) :-)
Ok for mainline?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2010-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* include/sparc-signal.h: Renamed to ...
* include/solaris-signal.h: ... this.
* configure.ac: Use it on any *-*-solaris2* target.
* configure: Regenerate.
* configure.host (i?86-*-solaris2*): Set can_unwind_signal=yes.
diff -r de0d2ffd7b34 -r f1620ac6263c libjava/configure
--- a/libjava/configure Wed Feb 17 09:08:18 2010 +0100
+++ b/libjava/configure Wed Feb 17 23:05:38 2010 +0100
@@ -23836,8 +23836,8 @@
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
- sparc*-sun-solaris*)
- SIGNAL_HANDLER=include/sparc-signal.h
+ *-*-solaris2*)
+ SIGNAL_HANDLER=include/solaris-signal.h
;;
# ia64-*)
# SYSDEP_SOURCES=sysdep/ia64.c
diff -r de0d2ffd7b34 -r f1620ac6263c libjava/configure.ac
--- a/libjava/configure.ac Wed Feb 17 09:08:18 2010 +0100
+++ b/libjava/configure.ac Wed Feb 17 23:05:38 2010 +0100
@@ -1651,8 +1651,8 @@
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
- sparc*-sun-solaris*)
- SIGNAL_HANDLER=include/sparc-signal.h
+ *-*-solaris2*)
+ SIGNAL_HANDLER=include/solaris-signal.h
;;
# ia64-*)
# SYSDEP_SOURCES=sysdep/ia64.c
diff -r de0d2ffd7b34 -r f1620ac6263c libjava/configure.host
--- a/libjava/configure.host Wed Feb 17 09:08:18 2010 +0100
+++ b/libjava/configure.host Wed Feb 17 23:05:38 2010 +0100
@@ -318,6 +318,9 @@
DIVIDESPEC=-fuse-divide-subroutine
CHECKREFSPEC=-fcheck-references
;;
+ i?86-*-solaris2*)
+ can_unwind_signal=yes
+ ;;
*-*-freebsd*)
slow_pthread_self=
;;
diff -r de0d2ffd7b34 -r f1620ac6263c libjava/include/solaris-signal.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libjava/include/solaris-signal.h Wed Feb 17 23:05:38 2010 +0100
@@ -0,0 +1,48 @@
+// sparc-signal.h - Catch runtime signals and turn them into exceptions.
+
+/* Copyright (C) 1998, 1999, 2000, 2009 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#ifndef JAVA_SIGNAL_H
+#define JAVA_SIGNAL_H 1
+
+#include <signal.h>
+
+#define HANDLE_SEGV 1
+#define HANDLE_FPE 1
+
+#define SIGNAL_HANDLER(_name) \
+static void _Jv_##_name (int, \
+ siginfo_t *_si __attribute__ ((__unused__)), \
+ void *_uc __attribute__ ((__unused__)))
+
+#define MAKE_THROW_FRAME(_exception)
+
+#define INIT_SEGV \
+do \
+ { \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_segv; \
+ act.sa_flags = SA_SIGINFO | SA_NODEFER; \
+ sigemptyset (&act.sa_mask); \
+ sigaction (SIGSEGV, &act, NULL); \
+ } \
+while (0)
+
+#define INIT_FPE \
+do \
+ { \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_fpe; \
+ act.sa_flags = SA_SIGINFO | SA_NODEFER; \
+ sigemptyset (&act.sa_mask); \
+ sigaction (SIGFPE, &act, NULL); \
+ } \
+while (0)
+
+#endif /* JAVA_SIGNAL_H */
diff -r de0d2ffd7b34 -r f1620ac6263c libjava/include/sparc-signal.h
--- a/libjava/include/sparc-signal.h Wed Feb 17 09:08:18 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-// sparc-signal.h - Catch runtime signals and turn them into exceptions.
-
-/* Copyright (C) 1998, 1999, 2000, 2009 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#ifndef JAVA_SIGNAL_H
-#define JAVA_SIGNAL_H 1
-
-#include <signal.h>
-
-#define HANDLE_SEGV 1
-#define HANDLE_FPE 1
-
-#define SIGNAL_HANDLER(_name) \
-static void _Jv_##_name (int, \
- siginfo_t *_si __attribute__ ((__unused__)), \
- void *_uc __attribute__ ((__unused__)))
-
-#define MAKE_THROW_FRAME(_exception)
-
-#define INIT_SEGV \
-do \
- { \
- struct sigaction act; \
- act.sa_sigaction = _Jv_catch_segv; \
- act.sa_flags = SA_SIGINFO | SA_NODEFER; \
- sigemptyset (&act.sa_mask); \
- sigaction (SIGSEGV, &act, NULL); \
- } \
-while (0)
-
-#define INIT_FPE \
-do \
- { \
- struct sigaction act; \
- act.sa_sigaction = _Jv_catch_fpe; \
- act.sa_flags = SA_SIGINFO | SA_NODEFER; \
- sigemptyset (&act.sa_mask); \
- sigaction (SIGFPE, &act, NULL); \
- } \
-while (0)
-
-#endif /* JAVA_SIGNAL_H */