2002-05-02 David S. Miller <davem@redhat.com>
authordavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 May 2002 17:54:24 +0000 (17:54 +0000)
committerdavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 May 2002 17:54:24 +0000 (17:54 +0000)
PR bootstrap/6525
* include/dwarf2-signal.h (INIT_SEGV, INIT_FPE): Don't use
__libc_sigaction on Sparc.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53055 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/include/dwarf2-signal.h

index c774a85..4cda57b 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-02  David S. Miller  <davem@redhat.com>
+
+       PR bootstrap/6525
+       * include/dwarf2-signal.h (INIT_SEGV, INIT_FPE): Don't use
+       __libc_sigaction on Sparc.
+
 2002-05-02  Jerome Marc  <marcjero@yahoo.com>
 
        * java/net/natPlainSocketImpl.cc: Include sys/ioctl.h and
index b7530b2..21decd5 100644 (file)
@@ -122,7 +122,93 @@ do                                         \
 while (0)
 #endif
 
-#if !(defined(__ia64__) || defined(__sparc__))
+#if defined(__sparc__)
+#if defined(__arch64__)
+extern "C" {
+    static void __rt_sigreturn_stub(void)
+    {
+      __asm__("mov %0, %%g1\n\t"
+             "ta  0x6d\n\t"
+             : /* no outputs */
+             : "i" (__NR_rt_sigreturn));
+    }
+    struct kernel_sigaction
+    {
+      void (*k_sa_sigaction)(int,siginfo_t *,void *);
+      unsigned long k_sa_flags;
+      void (*k_sa_restorer)(void);
+      sigset_t k_sa_mask;
+    };
+}
+#define INIT_SEGV                                              \
+do                                                             \
+  {                                                            \
+    nullp = new java::lang::NullPointerException ();           \
+    struct kernel_sigaction act;                               \
+    unsigned long stub = ((unsigned long)&__rt_sigreturn_stub); \
+    act.k_sa_sigaction = _Jv_catch_segv;                       \
+    sigemptyset (&act.k_sa_mask);                              \
+    act.k_sa_flags = SA_SIGINFO;                               \
+    act.k_sa_restorer = NULL;                                  \
+    syscall (SYS_rt_sigaction, SIGSEGV, &act, NULL,            \
+             stub - 8, _NSIG / 8);                             \
+  }                                                            \
+while (0)  
+
+#define INIT_FPE                                               \
+do                                                             \
+  {                                                            \
+    arithexception = new java::lang::ArithmeticException       \
+      (JvNewStringLatin1 ("/ by zero"));                       \
+    struct kernel_sigaction act;                               \
+    unsigned long stub = ((unsigned long)&__rt_sigreturn_stub); \
+    act.k_sa_sigaction = _Jv_catch_fpe;                                \
+    sigemptyset (&act.k_sa_mask);                              \
+    act.k_sa_flags = SA_SIGINFO;                               \
+    act.k_sa_restorer = NULL;                                  \
+    syscall (SYS_rt_sigaction, SIGFPE, &act, NULL,             \
+             stub - 8, _NSIG / 8);                             \
+  }                                                            \
+while (0)  
+#else /* __arch64__ */
+
+extern "C" {
+    struct kernel_sigaction
+    {
+      void (*k_sa_sigaction)(int,siginfo_t *,void *);
+      unsigned long k_sa_mask, k_sa_flags;
+      void (*k_sa_restorer)(void);
+    };
+}
+
+#define INIT_SEGV                                              \
+do                                                             \
+  {                                                            \
+    struct kernel_sigaction act;                               \
+    nullp = new java::lang::NullPointerException ();           \
+    act.k_sa_sigaction = _Jv_catch_segv;                       \
+    act.k_sa_mask = 0;                                         \
+    act.k_sa_flags = SA_SIGINFO;                               \
+    act.k_sa_restorer = NULL;                                  \
+    syscall (SYS_sigaction, -SIGSEGV, &act, NULL);             \
+  }                                                            \
+while (0)  
+
+#define INIT_FPE                                               \
+do                                                             \
+  {                                                            \
+    arithexception = new java::lang::ArithmeticException       \
+      (JvNewStringLatin1 ("/ by zero"));                       \
+    struct kernel_sigaction act;                               \
+    act.k_sa_sigaction = _Jv_catch_fpe;                                \
+    act.k_sa_mask = 0;                                         \
+    act.k_sa_flags = SA_SIGINFO;                               \
+    act.k_sa_restorer = NULL;                                  \
+    syscall (SYS_sigaction, -SIGFPE, &act, NULL);              \
+  }                                                            \
+while (0)  
+#endif
+#elif !defined(__ia64__)
 #define INIT_SEGV                                              \
 do                                                             \
   {                                                            \
@@ -155,7 +241,7 @@ while (0)
  * go away once all systems have pthreads libraries that are
  * compiled with full unwind info.  */
 
-#else  /* __ia64__ || __sparc__ */
+#else  /* __ia64__ */
 
 // FIXME: We shouldn't be using libc_sigaction here, since it should
 // be glibc private.  But using syscall here would mean translating to