cd /usr/local/go/src
CGO_ENABLED=0 GOOS=linux GOARCH=arm ./make.bash
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
libmach
misc/pprof
cmd/addr2line
cmd/cov
cmd/nm
cmd/objdump
cmd/pack
cmd/prof
cmd/cc
cmd/gc
cmd/6l
cmd/5l
/usr/local/go/src/cmd/5l/../ld/lib.c:661:9: error: no case matching constant switch condition '53'
[-Werror]
switch(thechar){
.......^~~~~~~
1 error generated.
go tool dist: FAILED: gcc -Wall -Wstrict-prototypes -Wno-sign-compare -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb -pipe -O2 -mmacosx-version-min=10.6 -c -m64 -I /usr/local/go/include -I /usr/local/go/src/cmd/5l -o /usr/local/go/pkg/obj/cmd/5l/lib.o /usr/local/go/src/cmd/5l/../ld/lib.c
CGO_ENABLED=0 GOOS=linux GOARCH=<b>amd64</b> ./make.bash
是正常的!
只有“arm”不正常。
#/ usr / local / go / src / cmd / ld / lib.c code:
vi cmd/ld/lib.c
661 switch(thechar){
662 case '8':
663 argv[argc++] = "-m32";
664 break;
665 case '6':
666 argv[argc++] = "-m64";
667 break;
668 }
答案 0 :(得分:-1)
我真的不确定OSX中的任何内容,但也许命令应该是
export CGO_ENABLED=0 ; export GOOS=linux ; export GOARCH=arm ; ./make.bash
代替?