summaryrefslogtreecommitdiffstats
path: root/libjava
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-24 02:44:26 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-24 02:44:26 +0000
commitf00ad21f9735625bdafd29c11bc6db0491d8fe2a (patch)
treecdff866a281ed7a6ebc131100612f4a22c136c64 /libjava
parentd8ff58268091282d724fa7735ad02b0b33b78f47 (diff)
downloadppe42-gcc-f00ad21f9735625bdafd29c11bc6db0491d8fe2a.tar.gz
ppe42-gcc-f00ad21f9735625bdafd29c11bc6db0491d8fe2a.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141335 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog10
-rw-r--r--libjava/classpath/native/fdlibm/fdlibm.h8
-rwxr-xr-xlibjava/configure5
-rw-r--r--libjava/configure.ac5
-rw-r--r--libjava/include/aix-signal.h50
-rw-r--r--libjava/sysdep/powerpc/locks.h16
6 files changed, 83 insertions, 11 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 7377e625c5c..d6687afcb45 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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).
diff --git a/libjava/classpath/native/fdlibm/fdlibm.h b/libjava/classpath/native/fdlibm/fdlibm.h
index 112504e4cc4..fc10ecc9ce4 100644
--- a/libjava/classpath/native/fdlibm/fdlibm.h
+++ b/libjava/classpath/native/fdlibm/fdlibm.h
@@ -24,6 +24,14 @@
#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: */
diff --git a/libjava/configure b/libjava/configure
index ffee0691ea1..225ffa6d32f 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -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
;;
diff --git a/libjava/configure.ac b/libjava/configure.ac
index de189e393f8..db131b68027 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -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
index 00000000000..abf37229235
--- /dev/null
+++ b/libjava/include/aix-signal.h
@@ -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 */
diff --git a/libjava/sysdep/powerpc/locks.h b/libjava/sysdep/powerpc/locks.h
index fe4f01ec182..2e9eb0eb36c 100644
--- a/libjava/sysdep/powerpc/locks.h
+++ b/libjava/sysdep/powerpc/locks.h
@@ -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");
OpenPOWER on IntegriCloud