On Fri, Nov 19, 2010 at 01:23:14PM -0800, Ian Lance Taylor wrote: > Jack Howarth <howa...@bromo.med.uc.edu> writes: > > > Actually, darwin doesn't use the boehm-gc/pthread_stop_world.c containing > > the SIGRTMIN code. There is an entirely separate > > boehm-gc/darwin_stop_world.c > > for the thread handling on darwin. While boehm-gc/pthread_stop_world.c is > > compiled on darwin, the code in it is skipped because of the... > > You probably know this, but to be pedantically clear, the garbage > collector in libgo doesn't use boehm-gc. It's entirely separate code. > > Clearly the boehm-gc Darwin support would be a good starting point for > libgo Darwin support, though. > > Ian
Ian, We might be able to use... Index: libgo/runtime/go-go.c =================================================================== --- libgo/runtime/go-go.c (revision 166953) +++ libgo/runtime/go-go.c (working copy) @@ -43,8 +43,13 @@ /* We stop the threads by sending them the signal GO_SIG_STOP and we start them by sending them the signal GO_SIG_START. */ +#if defined(__MACH__) +#define GO_SIG_START SIGUSR1 +#define GO_SIG_STOP SIGUSR2 +#else #define GO_SIG_START (SIGRTMIN + 1) #define GO_SIG_STOP (SIGRTMIN + 2) +#endif #ifndef SA_RESTART #define SA_RESTART 0 on darwin since our sys/signal.h has... #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */ This allows the compilation to proceed to another error... /bin/sh ./libtool --tag=CC --mode=compile /Users/howarth/darwin_objdir/./gcc/xgcc -B/Users/howarth/darwin_objdir/./gcc/ -B/Users/howarth/dist/x86_64-apple-darwin10.5.0/bin/ -B/Users/howarth/dist/x86_64-apple-darwin10.5.0/lib/ -isystem /Users/howarth/dist/x86_64-apple-darwin10.5.0/include -isystem /Users/howarth/dist/x86_64-apple-darwin10.5.0/sys-include -DHAVE_CONFIG_H -I. -I../../../gccgo/libgo -I ../../../gccgo/libgo/runtime -I../../../gccgo/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -minline-all-stringops -I ../../../gccgo/libgo/../gcc -I ../../gcc/include -g -O2 -MT go-go.lo -MD -MP -MF .deps/go-go.Tpo -c -o go-go.lo `test -f 'runtime/go-go.c' || echo '../../../gccgo/libgo/'`runtime/go-go.c libtool: compile: /Users/howarth/darwin_objdir/./gcc/xgcc -B/Users/howarth/darwin_objdir/./gcc/ -B/Users/howarth/dist/x86_64-apple-darwin10.5.0/bin/ -B/Users/howarth/dist/x86_64-apple-darwin10.5.0/lib/ -isystem /Users/howarth/dist/x86_64-apple-darwin10.5.0/include -isystem /Users/howarth/dist/x86_64-apple-darwin10.5.0/sys-include -DHAVE_CONFIG_H -I. -I../../../gccgo/libgo -I ../../../gccgo/libgo/runtime -I../../../gccgo/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -minline-all-stringops -I ../../../gccgo/libgo/../gcc -I ../../gcc/include -g -O2 -MT go-go.lo -MD -MP -MF .deps/go-go.Tpo -c ../../../gccgo/libgo/runtime/go-go.c -fno-common -DPIC -o .libs/go-go.o ../../../gccgo/libgo/runtime/go-go.c:436:1: error: conflicting types for '__go_scanstacks' ../../../gccgo/libgo/runtime/runtime.h:132:6: note: previous declaration of '__go_scanstacks' was here where you have... void __go_scanstacks (void (*scan) (unsigned char *, int64_t)) in gccgo/libgo/runtime/go-go.c but... void __go_scanstacks(void (*scan)(byte *, int64)); in gccgo/libgo/runtime/runtime.h. Jack