[Gc] [patch] x86_64-apple-darwin support

Andreas Tobler toa at pop.agri.ch
Tue Jan 9 15:17:56 PST 2007


Hello all,

the attached patch brings basic, means 'make check' passes, support for 
x86_64-apple-darwin* (* >= 8 and xcode 2.4.1). I tested on 
i?86-apple-darwin8 and x86_64-apple-darwin8, also on 
powerpc-apple-darwin8.8.0. All pass.
No, I do not have a powerpc64-apple-darwin8.8.0, this is open.

A modified patch will go into gcc trunk, which will bring the same 
functionality there. This is just a fyi, Hans, if you agree.

Thanks goes to Eric C. from apple who has tested on Leopard and Dan 
Grayson who gave me a good value for the STACKBOTTOM.

But not to forget, Hans, who offered me cvs access to push out the crap 
I produce ;)

Comments are welcome.

Thanks,
Andreas

2007-01-10  Andreas Tobler  <a.tobler at schweiz.org>

	* configure.ac (i?86*-*-darwin*): Replaced HAS_I386_THREAD_STATE_* with
	HAS_X86_THREAD_STATE32_*.
	(x86_64-*-darwin*): Extended the above check for x86_64-*-darwin* with
	HAS_X86_THREAD_STATE64_*.
	Added value 1 in the above AC_DEFINE's. Important for the upcoming
	Leopard.
	* configure: Regenerated.
	* include/private/gcconfig.h: Modified X86_64 define for Darwin.
	Removed __x86_64__ check in POWERPC section. Added base definitions
	for the X86_64 Darwin port.
	* include/private/gc_priv.h: Added GC_MACH_HEADER and GC_MACH_SECTION
	to distinguish between 32 and 64-bit applications. Added definitions
	for X86_64 Darwin.
	* darwin_stop_world.c: Added HAS_X86_THREAD_STATE64___RAX. And
	replaced HAS_I386_THREAD_STATE__EAX with HAS_X86_THREAD_STATE32___EAX.
	(GC_push_all_stacks): Added code for X86_64 Darwin. Even for the
	!DARWIN_DONT_PARSE_STACK. Maybe obsolete.
	* dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
	(GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
	Distinguish between getsectbynamefromheader_64 and
	getsectbynamefromheader.
	* os_dep.c (catch_exception_raise): Introduce exception definition for
	X86_64 Darwin. Replaced old i386_EXCEPTION_STATE_* definition with
	x86_EXCEPTION_STATE32_*. Add X86_64 for exc_state.faultvaddr.
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/configure.ac,v
retrieving revision 1.18
diff -u -r1.18 configure.ac
--- configure.ac	14 Dec 2006 21:51:40 -0000	1.18
+++ configure.ac	9 Jan 2007 22:50:48 -0000
@@ -233,33 +233,46 @@
 case "$host" in
   powerpc*-*-darwin*)
     AC_CHECK_MEMBER(ppc_thread_state_t.r0,
-      AC_DEFINE(HAS_PPC_THREAD_STATE_R0,,[ppc_thread_state_t has field r0]),,
+      AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1,
+	[ppc_thread_state_t has field r0]),,
       [#include <mach/thread_status.h>])
     AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
-      AC_DEFINE(HAS_PPC_THREAD_STATE___R0,,dnl
-        [ppc_thread_state_t has field __r0]),,
+      AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl
+	[ppc_thread_state_t has field __r0]),,
       [#include <mach/thread_status.h>])
     AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
-      AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,,dnl
-        [ppc_thread_state64_t has field r0]),,
+      AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl
+	[ppc_thread_state64_t has field r0]),,
       [#include <mach/thread_status.h>])
     AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
-      AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,,dnl
-        [ppc_thread_state64_t has field __r0]),,
+      AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl
+	[ppc_thread_state64_t has field __r0]),,
       [#include <mach/thread_status.h>])
     ;;
   i?86*-*-darwin*)
-    AC_CHECK_MEMBER(i386_thread_state_t.eax,
-      AC_DEFINE(HAS_I386_THREAD_STATE_EAX,,dnl
-        [i386_thread_state_t has field eax]),,
+    AC_CHECK_MEMBER(x86_thread_state32_t.eax,
+      AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl
+	[x86_thread_state32_t has field eax]),,
       [#include <sys/cdefs.h>
-#include <mach/thread_status.h>])
-    AC_CHECK_MEMBER(i386_thread_state_t.__eax,
-      AC_DEFINE(HAS_I386_THREAD_STATE___EAX,,dnl
-        [i386_thread_state_t has field __eax]),,
+      #include <mach/thread_status.h>])
+    AC_CHECK_MEMBER(x86_thread_state32_t.__eax,
+      AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl
+	[x86_thread_state32_t has field __eax]),,
       [#include <sys/cdefs.h>
-#include <mach/thread_status.h>])
+      #include <mach/thread_status.h>])
     ;;
+  x86_64-*-darwin*)
+    AC_CHECK_MEMBER(x86_thread_state64_t.rax,
+      AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl
+	[x86_thread_state64_t has field rax]),,
+      [#include <sys/cdefs.h>
+      #include <mach/thread_status.h>])
+    AC_CHECK_MEMBER(x86_thread_state64_t.__rax,
+      AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl
+	[x86_thread_state64_t has field __rax]),,
+      [#include <sys/cdefs.h>
+      #include <mach/thread_status.h>])
+     ;;
   *) ;;
 esac
 
Index: darwin_stop_world.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/darwin_stop_world.c,v
retrieving revision 1.9
diff -u -r1.9 darwin_stop_world.c
--- darwin_stop_world.c	14 Dec 2006 21:51:40 -0000	1.9
+++ darwin_stop_world.c	9 Jan 2007 22:50:48 -0000
@@ -26,8 +26,10 @@
    The structure has changed its definition in different Darwin versions.  */
 /* This now defaults to the (older) names without __, thus hopefully	*/
 /* not breaking any existing Makefile.direct builds.			*/
-#if defined (HAS_PPC_THREAD_STATE___R0) || \
-    defined (HAS_I386_THREAD_STATE___EAX)
+#if defined (HAS_PPC_THREAD_STATE___R0) ||	\
+    defined (HAS_PPC_THREAD_STATE64___R0) ||	\
+    defined (HAS_X86_THREAD_STATE32___EAX) ||	\
+    defined (HAS_X86_THREAD_STATE64___RAX)
 #  define THREAD_FLD(x) __ ## x
 #else
 #  define THREAD_FLD(x) x
@@ -123,6 +125,32 @@
 	  GC_push_one(state . THREAD_FLD (edi)); 
 	  GC_push_one(state . THREAD_FLD (esi)); 
 	  GC_push_one(state . THREAD_FLD (ebp));
+
+#       elif defined(X86_64)
+	  lo = (void*)state . THREAD_FLD (rsp);
+
+	  GC_push_one(state . THREAD_FLD (rax));
+	  GC_push_one(state . THREAD_FLD (rbx));
+	  GC_push_one(state . THREAD_FLD (rcx));
+	  GC_push_one(state . THREAD_FLD (rdx));
+	  GC_push_one(state . THREAD_FLD (rdi));
+	  GC_push_one(state . THREAD_FLD (rsi));
+	  GC_push_one(state . THREAD_FLD (rbp));
+	  GC_push_one(state . THREAD_FLD (rsp));
+	  GC_push_one(state . THREAD_FLD (r8));
+	  GC_push_one(state . THREAD_FLD (r9));
+	  GC_push_one(state . THREAD_FLD (r10));
+	  GC_push_one(state . THREAD_FLD (r11));
+	  GC_push_one(state . THREAD_FLD (r12));
+	  GC_push_one(state . THREAD_FLD (r13));
+	  GC_push_one(state . THREAD_FLD (r14));
+	  GC_push_one(state . THREAD_FLD (r15));
+	  GC_push_one(state . THREAD_FLD (rip));
+	  GC_push_one(state . THREAD_FLD (rflags));
+	  GC_push_one(state . THREAD_FLD (cs));
+	  GC_push_one(state . THREAD_FLD (fs));
+	  GC_push_one(state . THREAD_FLD (gs));
+
 #       elif defined(POWERPC)
 	  lo = (void*)(state . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE);
         
@@ -241,8 +269,8 @@
 	GC_push_one(info . THREAD_FLD (r29)); 
 	GC_push_one(info . THREAD_FLD (r30)); 
 	GC_push_one(info . THREAD_FLD (r31));
-#      else
-	/* FIXME: This looks wrong for X86_64! */
+
+#      elif defined(I386)
 	/* FIXME: Remove after testing:	*/
 	WARN("This is completely untested and likely will not work\n", 0);
 	GC_THREAD_STATE_T info;
@@ -270,7 +298,41 @@
 	GC_push_one(info . THREAD_FLD (fs)); 
 	GC_push_one(info . THREAD_FLD (gs)); 
 
-#      endif /* !POWERPC */
+#      elif defined(X86_64)
+	GC_THREAD_STATE_T info;
+	mach_msg_type_number_t outCount = THREAD_STATE_MAX;
+	r = thread_get_state(thread, GC_MACH_THREAD_STATE,
+			     (natural_t *)&info, &outCount);
+	if(r != KERN_SUCCESS) ABORT("task_get_state failed");
+
+	lo = (void*)info . THREAD_FLD (rsp);
+	hi = (ptr_t)FindTopOfStack(info . THREAD_FLD (rsp));
+
+	GC_push_one(info . THREAD_FLD (rax));
+	GC_push_one(info . THREAD_FLD (rbx));
+	GC_push_one(info . THREAD_FLD (rcx));
+	GC_push_one(info . THREAD_FLD (rdx));
+	GC_push_one(info . THREAD_FLD (rdi));
+	GC_push_one(info . THREAD_FLD (rsi));
+	GC_push_one(info . THREAD_FLD (rbp));
+	GC_push_one(info . THREAD_FLD (rsp));
+	GC_push_one(info . THREAD_FLD (r8));
+	GC_push_one(info . THREAD_FLD (r9));
+	GC_push_one(info . THREAD_FLD (r10));
+	GC_push_one(info . THREAD_FLD (r11));
+	GC_push_one(info . THREAD_FLD (r12));
+	GC_push_one(info . THREAD_FLD (r13));
+	GC_push_one(info . THREAD_FLD (r14));
+	GC_push_one(info . THREAD_FLD (r15));
+	GC_push_one(info . THREAD_FLD (rip));
+	GC_push_one(info . THREAD_FLD (rflags));
+	GC_push_one(info . THREAD_FLD (cs));
+	GC_push_one(info . THREAD_FLD (fs));
+	GC_push_one(info . THREAD_FLD (gs));
+
+#      else
+#	  error FIXME for non-x86 || ppc architectures
+#      endif
       }
 #     if DEBUG_THREADS
        GC_printf("Darwin: Stack for thread 0x%lx = [%p,%p)\n",
Index: dyn_load.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/dyn_load.c,v
retrieving revision 1.8
diff -u -r1.8 dyn_load.c
--- dyn_load.c	17 Nov 2006 05:28:22 -0000	1.8
+++ dyn_load.c	9 Jan 2007 22:50:49 -0000
@@ -997,7 +997,7 @@
 };
     
 #ifdef DARWIN_DEBUG
-static const char *GC_dyld_name_for_hdr(struct mach_header *hdr) {
+static const char *GC_dyld_name_for_hdr(struct GC_MACH_HEADER *hdr) {
     unsigned long i,c;
     c = _dyld_image_count();
     for(i=0;i<c;i++) if(_dyld_get_image_header(i) == hdr)
@@ -1007,21 +1007,27 @@
 #endif
         
 /* This should never be called by a thread holding the lock */
-static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
+static void GC_dyld_image_add(const struct GC_MACH_HEADER* hdr, intptr_t slide)
+{
     unsigned long start,end,i;
-    const struct section *sec;
+    const struct GC_MACH_SECTION *sec;
     if (GC_no_dls) return;
     for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
-        sec = getsectbynamefromheader(
-            hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
-        if(sec == NULL || sec->size == 0) continue;
-        start = slide + sec->addr;
-        end = start + sec->size;
-#	ifdef DARWIN_DEBUG
-            GC_printf("Adding section at %p-%p (%lu bytes) from image %s\n",
-                      start,end,sec->size,GC_dyld_name_for_hdr(hdr));
-#	endif
-        GC_add_roots((char*)start,(char*)end);
+#if defined (__LP64__)
+      sec = getsectbynamefromheader_64(
+# else
+      sec = getsectbynamefromheader(
+#endif
+				    hdr, GC_dyld_sections[i].seg,
+				    GC_dyld_sections[i].sect);
+      if(sec == NULL || sec->size == 0) continue;
+      start = slide + sec->addr;
+      end = start + sec->size;
+#   ifdef DARWIN_DEBUG
+      GC_printf("Adding section at %p-%p (%lu bytes) from image %s\n",
+		start,end,sec->size,GC_dyld_name_for_hdr(hdr));
+#   endif
+      GC_add_roots((char*)start,(char*)end);
     }
 #   ifdef DARWIN_DEBUG
        GC_print_static_roots();
@@ -1029,23 +1035,30 @@
 }
 
 /* This should never be called by a thread holding the lock */
-static void GC_dyld_image_remove(struct mach_header* hdr, unsigned long slide) {
+static void GC_dyld_image_remove(const struct GC_MACH_HEADER* hdr,
+				 intptr_t slide)
+{
     unsigned long start,end,i;
-    const struct section *sec;
+    const struct GC_MACH_SECTION *sec;
     for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
-        sec = getsectbynamefromheader(
-            hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
-        if(sec == NULL || sec->size == 0) continue;
-        start = slide + sec->addr;
-        end = start + sec->size;
-#	ifdef DARWIN_DEBUG
-            GC_printf("Removing section at %p-%p (%lu bytes) from image %s\n",
-                      start,end,sec->size,GC_dyld_name_for_hdr(hdr));
-#	endif
-        GC_remove_roots((char*)start,(char*)end);
+#if defined (__LP64__)
+      sec = getsectbynamefromheader_64(
+# else
+      sec = getsectbynamefromheader(
+#endif
+				    hdr, GC_dyld_sections[i].seg,
+				    GC_dyld_sections[i].sect);
+      if(sec == NULL || sec->size == 0) continue;
+      start = slide + sec->addr;
+      end = start + sec->size;
+#   ifdef DARWIN_DEBUG
+      GC_printf("Removing section at %p-%p (%lu bytes) from image %s\n",
+		start,end,sec->size,GC_dyld_name_for_hdr(hdr));
+#   endif
+      GC_remove_roots((char*)start,(char*)end);
     }
 #   ifdef DARWIN_DEBUG
-        GC_print_static_roots();
+	GC_print_static_roots();
 #   endif
 }
 
Index: os_dep.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/os_dep.c,v
retrieving revision 1.17
diff -u -r1.17 os_dep.c
--- os_dep.c	6 Jan 2007 00:25:28 -0000	1.17
+++ os_dep.c	9 Jan 2007 22:50:51 -0000
@@ -3860,17 +3860,23 @@
 #   if defined(POWERPC)
 #     if CPP_WORDSZ == 32
         thread_state_flavor_t flavor = PPC_EXCEPTION_STATE;
-        mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE_COUNT;
-        ppc_exception_state_t exc_state;
+	mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE_COUNT;
+	ppc_exception_state_t exc_state;
 #     else
-        thread_state_flavor_t flavor = PPC_EXCEPTION_STATE64;
-        mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
-        ppc_exception_state64_t exc_state;
+	thread_state_flavor_t flavor = PPC_EXCEPTION_STATE64;
+	mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
+	ppc_exception_state64_t exc_state;
+#     endif
+#   elif defined(I386) || defined(X86_64)
+#     if CPP_WORDSZ == 32
+	thread_state_flavor_t flavor = x86_EXCEPTION_STATE32;
+	mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE32_COUNT;
+	x86_exception_state32_t exc_state;
+#     else
+	thread_state_flavor_t flavor = x86_EXCEPTION_STATE64;
+	mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE64_COUNT;
+	x86_exception_state64_t exc_state;
 #     endif
-#   elif defined(I386)
-        thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
-        mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
-        i386_exception_state_t exc_state;
 #   else
 #	error FIXME for non-ppc/x86 darwin
 #   endif
@@ -3904,7 +3910,7 @@
     /* This is the address that caused the fault */
 #if defined(POWERPC)
     addr = (char*) exc_state.dar;
-#elif defined (I386)
+#elif defined (I386) || defined (X86_64)
     addr = (char*) exc_state.faultvaddr;
 #else
 #   error FIXME for non POWERPC/I386
Index: include/private/gc_priv.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/gc_priv.h,v
retrieving revision 1.8
diff -u -r1.8 gc_priv.h
--- include/private/gc_priv.h	6 Jan 2007 00:25:28 -0000	1.8
+++ include/private/gc_priv.h	9 Jan 2007 22:50:53 -0000
@@ -366,17 +366,30 @@
 #if defined(DARWIN)
 #	if defined(POWERPC)
 #		if CPP_WORDSZ == 32
-# 		  define GC_THREAD_STATE_T ppc_thread_state_t
+#                 define GC_THREAD_STATE_T ppc_thread_state_t
+#		  define GC_MACH_HEADER mach_header
+#		  define GC_MACH_SECTION section
 #	        else
-# 		  define GC_THREAD_STATE_T ppc_thread_state64_t
+#                 define GC_THREAD_STATE_T ppc_thread_state64_t
+#		  define GC_MACH_HEADER mach_header_64
+#		  define GC_MACH_SECTION section_64
 #		endif
 #		define GC_MACH_THREAD_STATE PPC_THREAD_STATE
 #		define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
 #	elif defined(I386) || defined(X86_64)
-		/* FIXME: This looks dubious for X86_64	*/
-#		define GC_THREAD_STATE_T i386_thread_state_t
-#		define GC_MACH_THREAD_STATE i386_THREAD_STATE
-#		define GC_MACH_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT
+#               if CPP_WORDSZ == 32
+#		  define GC_THREAD_STATE_T x86_thread_state32_t
+#		  define GC_MACH_THREAD_STATE x86_THREAD_STATE32
+#		  define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
+#		  define GC_MACH_HEADER mach_header
+#		  define GC_MACH_SECTION section
+#               else
+#		  define GC_THREAD_STATE_T x86_thread_state64_t
+#		  define GC_MACH_THREAD_STATE x86_THREAD_STATE64
+#		  define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
+#		  define GC_MACH_HEADER mach_header_64
+#		  define GC_MACH_SECTION section_64
+#               endif
 #	else
 #		error define GC_THREAD_STATE_T
 #		define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
Index: include/private/gcconfig.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/gcconfig.h,v
retrieving revision 1.21
diff -u -r1.21 gcconfig.h
--- include/private/gcconfig.h	6 Jan 2007 00:25:28 -0000	1.21
+++ include/private/gcconfig.h	9 Jan 2007 22:50:54 -0000
@@ -295,8 +295,7 @@
 #   if defined(__ppc__)  || defined(__ppc64__)
 #    define POWERPC
 #    define mach_type_known
-#   endif
-#   if defined(__x86_64__)
+#   elif defined(__x86_64__)
 #    define X86_64
 #    define mach_type_known
 #   elif defined(__i386__)
@@ -749,7 +748,7 @@
 #     define DATAEND (_end)
 #   endif
 #   ifdef DARWIN
-#     if defined(__ppc64__) || defined(__x86_64__)
+#     if defined(__ppc64__)
 #       define ALIGNMENT 8
 #       define CPP_WORDSZ 64
 #     else
@@ -758,7 +757,7 @@
 #     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) */
+	 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)
@@ -766,8 +765,8 @@
 #     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
+	  os_dep.c.  It relies on threads to track writes. */
+/* #       define MPROTECT_VDB */
 #     endif
 #     include <unistd.h>
 #     define GETPAGESIZE() getpagesize()
@@ -779,7 +778,7 @@
 	  __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))
 #     endif
       /* There seems to be some issues with trylock hanging on darwin. This
-         should be looked into some more */
+	 should be looked into some more */
 #     define NO_PTHREAD_TRYLOCK
 #   endif
 #   ifdef FREEBSD
@@ -1869,6 +1868,28 @@
 #	    define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
 #	endif
 #   endif
+#   ifdef DARWIN
+#     define OS_TYPE "DARWIN"
+#     define DARWIN_DONT_PARSE_STACK
+#     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) 0x7fff5fc00000)
+#     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>
+#     define GETPAGESIZE() getpagesize()
+      /* There seems to be some issues with trylock hanging on darwin. This
+	 should be looked into some more */
+#     define NO_PTHREAD_TRYLOCK
+#   endif
 #   ifdef FREEBSD
 #	define OS_TYPE "FREEBSD"
 #	ifndef GC_FREEBSD_THREADS


More information about the Gc mailing list