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 # 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 # 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