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]

[patch] boehm-gc darwin backport r124870 to 4.2.x


Hello all,

there are some wishes to backport this one too.
Tested on ppc an i686-darwin.

Ok?

Thanks,
Andreas

2007-05-20 Andreas Tobler <a.tobler@schweiz.org>

* Backport r124870 from main.

2007-05-20 Andreas Tobler <a.tobler@schweiz.org>

	* configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
	* configure: Regenerate.
	* Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
	* Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
	targets. Remove comments. Prepare ppc64 support for Darwin.
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 124854)
+++ Makefile.am	(working copy)
@@ -33,11 +33,13 @@
 rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
 sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
 
+extra_ldflags_libgc = @extra_ldflags_libgc@
+
 # Include THREADLIBS here to ensure that the correct versions of
 # linuxthread semaphore functions get linked:
 libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
 libgcjgc_la_DEPENDENCIES = @addobjs@
-libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
+libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir)
 
 libgcjgc_convenience_la_LIBADD = @addobjs@
 libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
Index: configure.ac
===================================================================
--- configure.ac	(revision 124855)
+++ configure.ac	(working copy)
@@ -300,6 +300,14 @@
     ;;
 esac
 
+# extra LD Flags which are required for targets
+case "${host}" in
+  *-*-darwin*)
+    extra_ldflags_libgc=-Wl,-single_module
+    ;;
+esac
+AC_SUBST(extra_ldflags_libgc)
+
 AC_SUBST(EXTRA_TEST_LIBS)
 
 target_all=libgcjgc.la
Index: include/private/gcconfig.h
===================================================================
--- include/private/gcconfig.h	(revision 124855)
+++ include/private/gcconfig.h	(working copy)
@@ -794,26 +794,29 @@
 #     define DATAEND (_end)
 #   endif
 #   ifdef DARWIN
+#     define OS_TYPE "DARWIN"
+#     define DYNAMIC_LOADING
 #     if defined(__ppc64__)
 #       define ALIGNMENT 8
 #       define CPP_WORDSZ 64
+#       define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
+#       define CACHE_LINE_SIZE 64
+#       ifndef HBLKSIZE
+#         define HBLKSIZE 4096
+#       endif
 #     else
 #       define ALIGNMENT 4
+#       define STACKBOTTOM ((ptr_t) 0xc0000000)
 #     endif
-#     define OS_TYPE "DARWIN"
-#     define DYNAMIC_LOADING
       /* XXX: see get_end(3), get_etext() and get_end() should not be used.
 	 These aren't used when dyld support is enabled (it is by default) */
 #     define DATASTART ((ptr_t) get_etext())
 #     define DATAEND	((ptr_t) get_end())
-#     define STACKBOTTOM ((ptr_t) 0xc0000000)
 #     define USE_MMAP
 #     define USE_MMAP_ANON
 #     define USE_ASM_PUSH_REGS
-      /* This is potentially buggy. It needs more testing. See the comments in
-	 os_dep.c.  It relies on threads to track writes. */
 #     ifdef GC_DARWIN_THREADS
-/*#       define MPROTECT_VDB -- diabled for now.  May work for some apps. */
+#       define MPROTECT_VDB
 #     endif
 #     include <unistd.h>
 #     define GETPAGESIZE() getpagesize()
@@ -1327,10 +1330,8 @@
 #     define USE_MMAP
 #     define USE_MMAP_ANON
 #     define USE_ASM_PUSH_REGS
-      /* This is potentially buggy. It needs more testing. See the comments in
-	 os_dep.c.  It relies on threads to track writes. */
 #     ifdef GC_DARWIN_THREADS
-/* #       define MPROTECT_VDB -- disabled for now.  May work for some apps. */
+#       define MPROTECT_VDB
 #     endif
 #     include <unistd.h>
 #     define GETPAGESIZE() getpagesize()
@@ -2001,8 +2002,6 @@
 #     define USE_MMAP
 #     define USE_MMAP_ANON
 #     ifdef GC_DARWIN_THREADS
-       /* This is potentially buggy. It needs more testing. See the comments in
-	  os_dep.c.  It relies on threads to track writes. */
 #       define MPROTECT_VDB
 #     endif
 #     include <unistd.h>

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