* [patch] boehm-gc, darwin: backport MPROTECT_VDB stuff to gcc head
@ 2007-05-17 19:49 Andreas Tobler
2007-05-17 23:26 ` Mike Stump
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Tobler @ 2007-05-17 19:49 UTC (permalink / raw)
To: GCC Patches, Java Patches; +Cc: Hans Boehm
[-- Attachment #1: Type: text/plain, Size: 815 bytes --]
Hi all,
this patch enables the MPROTECT_VDB on all darwin targets. It is stuff
which is already in the bdwgc (boehm-gc) cvs.
It works under i?86-darwin, x86_64-darwin and ppc-darwin. It does not
work under ppc64-darwin. There nothing works atm.
I tested the attached patch under ?86 only. (32 and 64 bit), I can not
test it under ppc-darwin right now since bootstrap is broken there.
Ok for head once I can test under ppc-darwin?
Thanks,
Andreas
2007-05-17 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/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
targets. Remove comments. Prepare ppc64 support for Darwin.
[-- Attachment #2: mprotect_vdb-darwin_gcc_head.diff --]
[-- Type: text/plain, Size: 3462 bytes --]
Index: Makefile.am
===================================================================
--- Makefile.am (revision 124805)
+++ 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 124805)
+++ 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 124805)
+++ 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] boehm-gc, darwin: backport MPROTECT_VDB stuff to gcc head
2007-05-17 19:49 [patch] boehm-gc, darwin: backport MPROTECT_VDB stuff to gcc head Andreas Tobler
@ 2007-05-17 23:26 ` Mike Stump
0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2007-05-17 23:26 UTC (permalink / raw)
To: Andreas Tobler; +Cc: GCC Patches, Java Patches, Hans Boehm
On May 17, 2007, at 12:48 PM, Andreas Tobler wrote:
> this patch enables the MPROTECT_VDB on all darwin targets.
> I tested the attached patch under ?86 only. (32 and 64 bit), I can
> not test it under ppc-darwin right now since bootstrap is broken
> there.
:-(
Since this is a runtime library that should not affect the built bits
other than the runtime library, how about testing with a gcc built non-
bootstrapped by the same installed gcc?
> Ok for head once I can test under ppc-darwin?
Ok.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-17 23:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-17 19:49 [patch] boehm-gc, darwin: backport MPROTECT_VDB stuff to gcc head Andreas Tobler
2007-05-17 23:26 ` Mike Stump
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).