Unable to compile Go language on Mac OS X 10.6.7

When following the instructions Getting started - Go programming language , I get the code and try to run the all.bash script.

But I get this error after many other successful results:

 INSTALL FAIL net CGOPKGPATH= cgo -- cgo_bsd.go cgo_unix.go touch _obj/_cgo_run 6g -o _go_.6 dial.go dnsmsg.go fd_darwin.go hosts.go ip.go ipsock.go iprawsock.go lookup.go net.go parse.go pipe.go sock.go tcpsock.go udpsock.go unixsock.go newpollserver.go fd.go file.go dnsconfig.go dnsclient.go port.go _obj/cgo_bsd.cgo1.go _obj/cgo_unix.cgo1.go _obj/_cgo_gotypes.go 6c -FVw -I/Users/matryer/Work/go/pkg/darwin_amd64 -I . -o "_cgo_defun.6" _obj/_cgo_defun.c gcc -m64 -I . -g -fPIC -O2 -o _cgo_main.o -c _obj/_cgo_main.c gcc -m64 -I . -g -fPIC -O2 -o cgo_bsd.cgo2.o -c _obj/cgo_bsd.cgo2.c gcc -m64 -I . -g -fPIC -O2 -o cgo_unix.cgo2.o -c _obj/cgo_unix.cgo2.c gcc -m64 -I . -g -fPIC -O2 -o _cgo_export.o -c _obj/_cgo_export.c gcc -m64 -g -fPIC -O2 -o _cgo1_.o _cgo_main.o cgo_bsd.cgo2.o cgo_unix.cgo2.o _cgo_export.o cgo -dynimport _cgo1_.o >_obj/_cgo_import.c_ && mv -f _obj/_cgo_import.c_ _obj/_cgo_import.c 6c -FVw -I . -o "_cgo_import.6" _obj/_cgo_import.c cgo_bsd.go:5[_obj/cgo_bsd.cgo1.go:8]: undefined: _Cconst_AI_MASK cgo_unix.go:69[_obj/cgo_unix.cgo1.go:72]: undefined: _Cconst_AI_ALL cgo_unix.go:69[_obj/cgo_unix.cgo1.go:72]: undefined: _Cconst_AI_V4MAPPED cgo_unix.go:69[_obj/cgo_unix.cgo1.go:72]: undefined: _Cconst_AI_CANONNAME make[1]: *** [_go_.6] Error 1 make: *** [net.install] Error 1 

Has anyone else seen this and recorded it?

I am running Snow Leopard (10.6.7) build 10J869 .

+4
source share
2 answers

This is an open-ended question regarding the new version of Xcode for OS X 10.7 and 10.6.7.

Issue 1881 : Constant Error OCP on OS X 10.7

Note: The 142f0bc0d6e7 revision was made to close the 1881 release . To upgrade Go for all changes up to this version, enable this version:

 $ cd $GOROOT/src $ hg pull $ hg update 142f0bc0d6e7 $ ./all.bash 
+2
source

You do not indicate which version of Go you are building. Please note that this is a dynamic project in which versions change frequently.

I just ran hg pull and hg update in the directory where I previously compiled Go successfully (on MacOS X 10.6.7). Then I ran sh all.bash , and I did not see any problems at the build or test stages (although it takes longer to build now than with the first Go declaration).

FWIW, hg tags gives me:

 tip 8715:599657138e00 weekly.2011-06-09 8703:c81944152e97 weekly 8703:c81944152e97 weekly.2011-06-02 8623:3418f22c39eb weekly.2011-05-22 8483:c98449d685d2 release.r57.1 8294:95d2ce135523 

And the end of the build cycle gives:

 --- cd ../test 0 known bugs; 0 unexpected bugs ALL TESTS PASSED --- Installed Go for darwin/amd64 in /Users/jleffler/go. Installed commands in /Users/jleffler/bin. The compiler is 6g. 

Therefore...

It is likely that if you change the version of Go (possibly a newer one), then it will work for you too.


And, another FWIW or FYI, I redid the assembly on another machine that also uses MacOS X 10.6.7 this afternoon, and the version of the tooltip is slightly different, and there are apparently 2 known errors.

 --- cd ../test 2 known bugs; 0 unexpected bugs ALL TESTS PASSED --- Installed Go for darwin/amd64 in /Users/jleffler/External-Source-Repositories/hg/go. Installed commands in /Users/jleffler/External-Source-Repositories/hg/go/bin. *** You need to add /Users/jleffler/External-Source-Repositories/hg/go/bin to your $PATH. *** The compiler is 6g. On OS X the debuggers must be installed setgrp procmod. Read and run ./sudo.bash to install the debuggers. real 4m55.695s user 2m52.436s sys 1m10.222s Osiris-9 JL: hg tags | sed 15q tip 8716:164ef168486b weekly.2011-06-09 8703:c81944152e97 weekly 8703:c81944152e97 weekly.2011-06-02 8623:3418f22c39eb weekly.2011-05-22 8483:c98449d685d2 release.r57.1 8294:95d2ce135523 

Time information (less than 5 minutes for the build and test cycle) is started:

 time all.bash 
0
source

All Articles