]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/35485
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Oct 2008 02:44:26 +0000 (02:44 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Oct 2008 02:44:26 +0000 (02:44 +0000)
        * configure.ac: AIX threads are Posix threads.
        Set signal handler to aix-signal.h
        * configure: Regenerate.
        * classpath/native/fdlibm/fdlibm.h: Undef hz.
        * include/aix-signal.h: New file.
        * sysdep/powerpc/locks.h: Avoid GNU Assembler syntax.

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

libjava/ChangeLog
libjava/classpath/native/fdlibm/fdlibm.h
libjava/configure
libjava/configure.ac
libjava/include/aix-signal.h [new file with mode: 0644]
libjava/sysdep/powerpc/locks.h

index 7377e625c5cdebcc8334561f13fb750c1e244385..d6687afcb4539a9ea3b7130a91cf9717f056893e 100644 (file)
@@ -1,3 +1,13 @@
+2008-10-23  David Edelsohn  <edelsohn@gnu.org>
+
+       PR target/35485
+       * configure.ac: AIX threads are Posix threads.
+       Set signal handler to aix-signal.h
+       * configure: Regenerate.
+       * classpath/native/fdlibm/fdlibm.h: Undef hz.
+       * include/aix-signal.h: New file.
+       * sysdep/powerpc/locks.h: Avoid GNU Assembler syntax.
+
 2008-10-22  Matthias Klose  <doko@ubuntu.com>
 
        Import GNU Classpath (libgcj-import-20081021).
index 112504e4cc40a119fa147c0bdd6a9e85877e616c..fc10ecc9ce481256534edc6c91176b44ac3d3277 100644 (file)
 #include <config.h>
 #include <stdlib.h>
 
+/*
+ * AIX includes a header that defines hz,
+ * which conflicts with an fdlibm variable in some functions.
+ */
+#ifdef _AIX
+#undef hz
+#endif
+
 /* GCJ LOCAL: Include files.  */
 #include "ieeefp.h"
 /* CLASSPATH LOCAL: */
index ffee0691ea13122285fe74e996065135cd75e3ae..225ffa6d32f498b540160a68232a791fb5550037 100755 (executable)
@@ -20711,7 +20711,7 @@ case "$THREADS" in
  no | none | single)
     THREADS=none
     ;;
- posix | posix95 | pthreads)
aix | posix | posix95 | pthreads)
     THREADS=posix
     case "$host" in
      *-*-linux*)
@@ -27510,6 +27510,9 @@ case "${host}" in
  powerpc*-*-darwin* | i?86-*-darwin9* | x86_64-*-darwin9*)
     SIGNAL_HANDLER=include/darwin-signal.h
     ;;
+ powerpc*-*-aix*)
+    SIGNAL_HANDLER=include/aix-signal.h
+    ;;
  *)
     SIGNAL_HANDLER=include/default-signal.h
     ;;
index de189e393f87ce6bc53563e90df1074fa67dc4f2..db131b68027a98ba0aabac47d504965841b4758e 100644 (file)
@@ -938,7 +938,7 @@ case "$THREADS" in
  no | none | single)
     THREADS=none
     ;;
- posix | posix95 | pthreads)
aix | posix | posix95 | pthreads)
     THREADS=posix
     case "$host" in
      *-*-linux*)
@@ -1634,6 +1634,9 @@ case "${host}" in
  powerpc*-*-darwin* | i?86-*-darwin9* | x86_64-*-darwin9*)
     SIGNAL_HANDLER=include/darwin-signal.h
     ;;
+ powerpc*-*-aix*)
+    SIGNAL_HANDLER=include/aix-signal.h
+    ;;
  *)
     SIGNAL_HANDLER=include/default-signal.h
     ;;
diff --git a/libjava/include/aix-signal.h b/libjava/include/aix-signal.h
new file mode 100644 (file)
index 0000000..abf3722
--- /dev/null
@@ -0,0 +1,50 @@
+/* aix-signal.h - Catch runtime signals and turn them into exceptions,
+   on a Darwin system.  */
+
+/* Copyright (C) 2008  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.  */
+
+/* This file is really more of a specification.  The rest of the system
+   should be arranged so that this Just Works.  */
+
+#ifndef JAVA_SIGNAL_H
+# define JAVA_SIGNAL_H 1
+
+#include <sys/types.h>
+#include <sys/signal.h>
+
+typedef void (* SIG_PF)(int);
+
+# define HANDLE_SEGV 1
+# undef HANDLE_FPE
+
+# define SIGNAL_HANDLER(_name)                                 \
+  static void _name (int _dummy __attribute__ ((unused)))
+
+# define MAKE_THROW_FRAME(_exception)
+
+# define INIT_SEGV                             \
+  do {                                         \
+      struct sigaction sa;                     \
+      sa.sa_handler = catch_segv;              \
+      sigemptyset (&sa.sa_mask);               \
+      sa.sa_flags = SA_NODEFER;                        \
+      sigaction (SIGBUS, &sa, NULL);           \
+      sigaction (SIGSEGV, &sa, NULL);          \
+    } while (0)
+
+# define INIT_FPE                              \
+  do {                                         \
+      struct sigaction sa;                     \
+      sa.sa_handler = catch_fpe;               \
+      sigemptyset (&sa.sa_mask);               \
+      sa.sa_flags = SA_NODEFER;                        \
+      sigaction (SIGFPE, &sa, NULL);           \
+    } while (0)
+
+#endif /* JAVA_SIGNAL_H */
index fe4f01ec182bb5f68235ca3d4623e7918806e7a7..2e9eb0eb36c87d96803c606f834bcf594e295937 100644 (file)
@@ -1,6 +1,6 @@
 // locks.h - Thread synchronization primitives. PowerPC implementation.
 
-/* Copyright (C) 2002  Free Software Foundation
+/* Copyright (C) 2002,2008  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -33,12 +33,11 @@ compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old,
   obj_addr_t ret;
 
   __asm__ __volatile__ (
-          "0:    " _LARX "%0,0,%1 \n"
+          "      " _LARX "%0,0,%1 \n"
           "      xor. %0,%3,%0\n"
-          "      bne 1f\n"
+          "      bne $+12\n"
           "      " _STCX "%2,0,%1\n"
-          "      bne- 0b\n"
-          "1:   \n"
+          "      bne- $-16\n"
        : "=&r" (ret)
        : "r" (addr), "r" (new_val), "r" (old)
        : "cr0", "memory");
@@ -67,12 +66,11 @@ compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old,
   __asm__ __volatile__ ("sync" : : : "memory");
 
   __asm__ __volatile__ (
-          "0:    " _LARX "%0,0,%1 \n"
+          "      " _LARX "%0,0,%1 \n"
           "      xor. %0,%3,%0\n"
-          "      bne 1f\n"
+          "      bne $+12\n"
           "      " _STCX "%2,0,%1\n"
-          "      bne- 0b\n"
-          "1:   \n"
+          "      bne- $-16\n"
        : "=&r" (ret)
        : "r" (addr), "r" (new_val), "r" (old)
        : "cr0", "memory");