On Fri, Nov 19, 2010 at 03:59:40PM -0800, Ian Lance Taylor wrote:
> Jack Howarth <howa...@bromo.med.uc.edu> writes:
> 
> > 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.
> 
> Thanks.  I don't know why this causes an error on Darwin but not on
> GNU/Linux, but I guess I don't care all that much.  I just committed a
> patch which should fix the problem.
> 
> Ian

Ian,
   Actually that wasn't the fix. The change...

Index: libgo/runtime/go-go.c
===================================================================
--- libgo/runtime/go-go.c       (revision 166968)
+++ 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
@@ -428,7 +433,7 @@
    with __go_thread_ids_lock held.  */
 
 void
-__go_scanstacks (void (*scan) (byte *, int64_t))
+__go_scanstacks (void (*scan) (unsigned char *, int64))
 {
   pthread_t me;
   struct __go_thread_id *p;

solves the problem (int64_t vs int64). I changed it to int64 since
you are using that elsewhere for this call. This allows the build to proceed 
to...

rm -f `echo runtime/libruntime.a | sed -e 's|/lib|/|' -e 's/\.a/.gox/'`; test 
-d runtime || ../../../gccgo/libgo/../install-sh -c -d runtime; rm -f 
runtime/libruntime.a; files=`echo ../../../gccgo/libgo/go/runtime/debug.go 
../../../gccgo/libgo/go/runtime/error.go 
../../../gccgo/libgo/go/runtime/extern.go 
../../../gccgo/libgo/go/runtime/sig.go 
../../../gccgo/libgo/go/runtime/softfloat64.go 
../../../gccgo/libgo/go/runtime/type.go version.go | sed -e 's/[^ ]*\.gox//g'`; 
if /bin/sh ./libtool --tag GO --mode=compile 
/Users/howarth/darwin_objdir/./gcc/gccgo -B/Users/howarth/darwin_objdir/./gcc/  
-minline-all-stringops -O2 -g -c -fgo-prefix="libgo_runtime" -o 
runtime/libruntime.a.o $files; then ar rc runtime/libruntime.a 
runtime/libruntime.a.o; else exit 1; fi
libtool: compile:  /Users/howarth/darwin_objdir/./gcc/gccgo 
-B/Users/howarth/darwin_objdir/./gcc/ -minline-all-stringops -O2 -g -c 
-fgo-prefix=libgo_runtime ../../../gccgo/libgo/go/runtime/debug.go 
../../../gccgo/libgo/go/runtime/error.go 
../../../gccgo/libgo/go/runtime/extern.go 
../../../gccgo/libgo/go/runtime/sig.go 
../../../gccgo/libgo/go/runtime/softfloat64.go 
../../../gccgo/libgo/go/runtime/type.go version.go 
/var/tmp//ccVFZHcc.s:3:Expected comma after segment-name
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 32 ( ).
/var/tmp//ccVFZHcc.s:3:Junk character 92 (\).
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 49 (1).
../../../gccgo/libgo/go/runtime/error.go:20:19: error: use of undefined type 
'Type'
../../../gccgo/libgo/go/runtime/error.go:20:19: error: use of undefined type 
'Type'
../../../gccgo/libgo/go/runtime/error.go:20:19: error: use of undefined type 
'Type'
../../../gccgo/libgo/go/runtime/error.go:20:19: error: use of undefined type 
'Type'
go1: internal compiler error: in do_get_tree, at 
go/gofrontend/expressions.cc:1177
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
../../../gccgo/libgo/go/runtime/extern.go:181:23: error: reference to undefined 
name 'theGoarch'
../../../gccgo/libgo/go/runtime/extern.go:163:9: error: reference to undefined 
name 'defaultGoroot'
../../../gccgo/libgo/go/runtime/extern.go:172:9: error: reference to undefined 
name 'theVersion'
../../../gccgo/libgo/go/runtime/extern.go:177:21: error: reference to undefined 
name 'theGoos'
/var/tmp//ccVFZHcc.s:3:Expected comma after segment-name
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 32 ( ).
/var/tmp//ccVFZHcc.s:3:Junk character 92 (\).
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 49 (1).
/var/tmp//ccVFZHcc.s:3:Expected comma after segment-name
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 32 ( ).
/var/tmp//ccVFZHcc.s:3:Junk character 92 (\).
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 49 (1).
/var/tmp//ccVFZHcc.s:3:Expected comma after segment-name
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 32 ( ).
/var/tmp//ccVFZHcc.s:3:Junk character 92 (\).
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 49 (1).
/var/tmp//ccVFZHcc.s:3:Expected comma after segment-name
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 32 ( ).
/var/tmp//ccVFZHcc.s:3:Junk character 92 (\).
/var/tmp//ccVFZHcc.s:3:Rest of line ignored. 1st junk character valued 49 (1).
make[4]: *** [runtime/libruntime.a] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-target-libgo] Error 2
make: *** [all] Error 2

So it appears that Go needs to learn about the Mach-O object file format.
            Jack
o

Reply via email to