From: Andreas Tobler <toa@pop.agri.ch>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
Java Patches <java-patches@gcc.gnu.org>
Cc: Hans Boehm <Hans.Boehm@hp.com>
Subject: [patch] boehm-gc, darwin: backport MPROTECT_VDB stuff to gcc head
Date: Thu, 17 May 2007 19:49:00 -0000 [thread overview]
Message-ID: <464CB1A4.7010405@pop.agri.ch> (raw)
[-- 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>
next reply other threads:[~2007-05-17 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-17 19:49 Andreas Tobler [this message]
2007-05-17 23:26 ` Mike Stump
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=464CB1A4.7010405@pop.agri.ch \
--to=toa@pop.agri.ch \
--cc=Hans.Boehm@hp.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).