[Gc] libgc changes necessary in darwin_stop_world.c to compile on OSX 10.5.3

Kyle Hamilton wolfoftheair at mac.com
Wed Jul 2 00:00:58 PDT 2008


Hi, I'm mailing this upstream from the dotgnu project.  I've found a  
problem in libgc that prevents it from compiling on OSX 10.5.3 (and  
most likely other versions), due to missing underscores in the thread  
structure.  Each register name in OSX is prefixed with two underscores.

I don't know if this is necessary in other Darwin variants, though, so  
please be warned.

Thanks!

-Kyle H

Index: darwin_stop_world.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/libgc/darwin_stop_world.c,v
retrieving revision 1.4
diff -c -r1.4 darwin_stop_world.c
*** darwin_stop_world.c	5 Nov 2006 18:49:52 -0000	1.4
--- darwin_stop_world.c	2 Jul 2008 06:55:33 -0000
***************
*** 102,116 ****
   	if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
   	
   #if defined(I386)
! 	lo = state.esp;

! 	GC_push_one(state.eax);
! 	GC_push_one(state.ebx);
! 	GC_push_one(state.ecx);
! 	GC_push_one(state.edx);
! 	GC_push_one(state.edi);
! 	GC_push_one(state.esi);
! 	GC_push_one(state.ebp);
   #elif defined(POWERPC)
   	lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);

--- 102,116 ----
   	if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
   	
   #if defined(I386)
! 	lo = state.__esp;

! 	GC_push_one(state.__eax);
! 	GC_push_one(state.__ebx);
! 	GC_push_one(state.__ecx);
! 	GC_push_one(state.__edx);
! 	GC_push_one(state.__edi);
! 	GC_push_one(state.__esi);
! 	GC_push_one(state.__ebp);
   #elif defined(POWERPC)
   	lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);




More information about the Gc mailing list