This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] libgcj enable hash_syncronization & pthread_slow on darwin
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Java Patches <java-patches at gcc dot gnu dot org>
- Cc: Geoffrey Keating <geoffk at geoffk dot org>
- Date: Mon, 05 Jul 2004 22:56:21 +0200
- Subject: [patch] libgcj enable hash_syncronization & pthread_slow on darwin
Hi,
the attached patch enables enable_hash_synchronization_default and
slow_pthread_self on darwin. The hash sync part is necessary to get some
swing stuff working. Without we hang forever.
About the benefit of slow_pthread_self I'm not quite sure. Maybe it
would help on a G5?
Tested on a G4 Powerbook with darwin-7.4.0, no regressions. And ppc32
linux. Also compiled by Janis on a ppc64 system.
Ok for main?
Andreas
2004-07-05 Andreas Tobler <a.tobler@schweiz.ch>
* configure.host: Enable hash synchronization and slow_pthread_self
on Darwin.
* sysdep/powerpc/locks.h (compare_and_swap): Use '\n' instead of
';', since this is a comment on Darwin.
(compare_and_swap_release): Likewise.
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.host,v
retrieving revision 1.58
diff -u -r1.58 configure.host
--- configure.host 1 Jul 2004 04:09:07 -0000 1.58
+++ configure.host 5 Jul 2004 20:50:10 -0000
@@ -164,6 +164,7 @@
case "${host}" in
i[34567]86*-linux* | \
powerpc*-linux* | \
+ powerpc*-*-darwin* | \
alpha*-linux* | \
s390*-linux* | \
sparc*-linux* | \
@@ -233,8 +234,8 @@
esac
;;
powerpc*-*-darwin*)
- enable_hash_synchronization_default=no
- slow_pthread_self=
+ enable_hash_synchronization_default=yes
+ slow_pthread_self=yes
can_unwind_signal=yes
;;
*-*-freebsd*)
Index: sysdep/powerpc/locks.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/sysdep/powerpc/locks.h,v
retrieving revision 1.3
diff -u -r1.3 locks.h
--- sysdep/powerpc/locks.h 29 Jul 2002 23:26:27 -0000 1.3
+++ sysdep/powerpc/locks.h 5 Jul 2004 20:50:10 -0000
@@ -33,12 +33,12 @@
int ret;
__asm__ __volatile__ (
- "0: " _LARX "%0,0,%1 ;"
- " xor. %0,%3,%0;"
- " bne 1f;"
- " " _STCX "%2,0,%1;"
- " bne- 0b;"
- "1: "
+ "0: " _LARX "%0,0,%1 \n"
+ " xor. %0,%3,%0\n"
+ " bne 1f\n"
+ " " _STCX "%2,0,%1\n"
+ " bne- 0b\n"
+ "1: \n"
: "=&r" (ret)
: "r" (addr), "r" (new_val), "r" (old)
: "cr0", "memory");
@@ -67,12 +67,12 @@
__asm__ __volatile__ ("sync" : : : "memory");
__asm__ __volatile__ (
- "0: " _LARX "%0,0,%1 ;"
- " xor. %0,%3,%0;"
- " bne 1f;"
- " " _STCX "%2,0,%1;"
- " bne- 0b;"
- "1: "
+ "0: " _LARX "%0,0,%1 \n"
+ " xor. %0,%3,%0\n"
+ " bne 1f\n"
+ " " _STCX "%2,0,%1\n"
+ " bne- 0b\n"
+ "1: \n"
: "=&r" (ret)
: "r" (addr), "r" (new_val), "r" (old)
: "cr0", "memory");