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]
Other format: [Raw text]

Re: [Patch] libffi: Add MIPS64 support.


On Fri, 10 Aug 2007, David Daney wrote:

> Assuming that you have a copyright assignment for GCC, please send the gcj
> patches to java-patches@gcc.gnu.org.  I am going to work on GCJ next.

 I have.  It turns out I have two patches; one for configury and just 
removes ${libgcj} from ${noconfigdirs}, so I will skip it, and the other 
one for signal handling; see below.

> Currently gcj works well enough that a simple Hello world program works on
> n32.  There is a problem in boehm-gc that prevents n64 from working.  Finding
> and fixing that will be my next project.

 Great.  For me libjava builds correctly for n64, but I cannot say I did a 
lot of run-time checking.  I think a "Hello World" program worked for me 
once, but I might be confusing something.  One I know for sure is 
`gcj-dbtool' that is run at the end of the build segfaults and gdb up to 
6.6 is not capable enough to debug an n64 binary at the moment, so I have 
given up for now.

2007-08-10  Maciej W. Rozycki  <macro@linux-mips.org>

	* include/mips-signal.h: Handle the n32 and n64 ABIs.

 Please note this patch does not apply to the trunk, but it should be 
easy to update.  I can see sigaction() is now called though, so perhaps 
the patch is not needed at all.

  Maciej

gcc-4.0.0-20050331-mips64-libjava.patch
diff -up --recursive --new-file gcc-4.0.0-20050331.macro/libjava/include/mips-signal.h gcc-4.0.0-20050331/libjava/include/mips-signal.h
--- gcc-4.0.0-20050331.macro/libjava/include/mips-signal.h	2004-10-16 05:58:12.000000000 +0000
+++ gcc-4.0.0-20050331/libjava/include/mips-signal.h	2005-04-04 21:15:39.000000000 +0000
@@ -1,7 +1,8 @@
 // mips-signal.h - Catch runtime signals and turn them into exceptions
 // on an mips based Linux system. 
 
-/* Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005
+   Free Software Foundation
 
    This file is part of libgcj.
 
@@ -15,6 +16,7 @@ details.  */
 #ifndef JAVA_SIGNAL_H
 #define JAVA_SIGNAL_H 1
 
+#include <sgidefs.h>
 #include <signal.h>
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -75,7 +77,36 @@ while (0)
 /* For an explanation why we cannot simply use sigaction to
    install the handlers, see i386-signal.h.  */
 
-#define INIT_SEGV                                    \
+#if !defined(_MIPS_SIM)
+#  error -- something is very wrong --
+#elif (_MIPS_SIM == _ABIN32 && defined(_ABIN32)) \
+      || (_MIPS_SIM == _ABI64 && defined(_ABI64))
+
+#  define INIT_SEGV                                  \
+do                                                   \
+  {                                                  \
+    struct kernel_sigaction kact;                    \
+    kact.k_sa_handler = catch_segv;                  \
+    kact.k_sa_flags = SA_SIGINFO | SA_NODEFER;       \
+    sigemptyset (&kact.k_sa_mask);                   \
+    syscall (SYS_rt_sigaction, SIGSEGV, &kact, NULL, 16); \
+  }                                                  \
+while (0)
+
+#  define INIT_FPE                                   \
+do                                                   \
+  {                                                  \
+    struct kernel_sigaction kact;                    \
+    kact.k_sa_handler = catch_fpe;                   \
+    kact.k_sa_flags = SA_SIGINFO | SA_NODEFER;       \
+    sigemptyset (&kact.k_sa_mask);                   \
+    syscall (SYS_rt_sigaction, SIGFPE, &kact, NULL, 16); \
+  }                                                  \
+while (0)
+
+#elif _MIPS_SIM == _ABIO32 && defined(_ABIO32)
+
+#  define INIT_SEGV                                  \
 do                                                   \
   {                                                  \
     struct kernel_sigaction kact;                    \
@@ -86,7 +117,7 @@ do                                      
   }                                                  \
 while (0)
 
-#define INIT_FPE                                     \
+#  define INIT_FPE                                   \
 do                                                   \
   {                                                  \
     struct kernel_sigaction kact;                    \
@@ -97,6 +128,10 @@ do                                      
   }                                                  \
 while (0)
 
+#else
+#  error -- this is an unsupported platform --
+#endif
+
 #undef HANDLE_DIVIDE_OVERFLOW
 
 #endif /* JAVA_SIGNAL_H */


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