[Gc] Frustrations configuring libgc.a on MacOSX.

S M Ryan wyrmwif at rawbw.com
Thu Mar 1 16:50:29 PST 2007

I spent much of February getting mysterious collector bugs that  
turned out to be misconfigurations. Doing a vanilla configure or  
configure --enable-threads=pthreads doesn't seem to help.

	add to DEFS = ... -DHANDLE_FORK=1
		Leaving this out doesn't ensure threads locks are cleared
		across forks so the child risks deadlocking itself on allocate.

Including gc.h:
	#define GC_PTHREADS
		Leaving this out apparently runs without thread locks
		and libgc eventually stomps on its own toes.
	#include "gc.h"

I didn't see any obvious documentation on these; instead I discovered  
them by debugging and eventually finding comments in the code. It  
would help if this could be more obvious and/or automatic.

Another a generic rant about configure for MacOSX is that it doesn't  
add -arch and -isysroot flags, and it requires two separate configure  
runs, once on a i386 box and once on ppc box. However this happens  
with anything using configure. Go team.

More information about the Gc mailing list