diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2018-07-16 11:02:01 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-07-25 19:55:27 +0000 |
commit | 94221a06124fe0d0f7ed45a355c72e46ed0e891b (patch) | |
tree | 52bc9b15d82dea7ccef239e1aa61328e8add0d59 | |
parent | 4d5426a570c2820c5894a61b52e3dc147e4e7925 (diff) | |
download | go-94221a06124fe0d0f7ed45a355c72e46ed0e891b.tar.gz go-94221a06124fe0d0f7ed45a355c72e46ed0e891b.zip |
[release-branch.go1.4] make.bash: set CGO_ENABLED=0
cgo is not supported with 1.4.
In addition to (perhaps instead of) documenting it,
just enforce it in make.*.
Updates Homebrew/homebrew-core#18465
Change-Id: Iefb1860890d9ec525597b6d730e2189110818598
Reviewed-on: https://go-review.googlesource.com/124076
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-rwxr-xr-x | src/make.bash | 7 | ||||
-rw-r--r-- | src/make.bat | 6 | ||||
-rwxr-xr-x | src/make.rc | 5 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash index 104c3ba5fb..c048717c62 100755 --- a/src/make.bash +++ b/src/make.bash @@ -106,6 +106,13 @@ if [ "$(uname -s)" == "GNU/kFreeBSD" ]; then export CGO_ENABLED=0 fi +# cgo is not generally supported on 1.4. +# Disable unless explicitly requested. +# See also https://github.com/Homebrew/homebrew-core/issues/18465. +if [ "$CGO_ENABLED" == "" ]; then + export CGO_ENABLED=0 +fi + # Clean old generated file that will cause problems in the build. rm -f ./runtime/runtime_defs.go diff --git a/src/make.bat b/src/make.bat index fff1eb6011..9ad34784f9 100644 --- a/src/make.bat +++ b/src/make.bat @@ -37,6 +37,12 @@ setlocal set GOBUILDFAIL=0 +:: cgo is not generally supported on 1.4. +:: Disable unless explicitly requested. +if not x%CGO_ENABLED%==x goto cgodone +set CGO_ENABLED=0 +:cgodone + if exist make.bat goto ok echo Must run make.bat from Go src directory. goto fail diff --git a/src/make.rc b/src/make.rc index 7a62d6af00..cf41991907 100755 --- a/src/make.rc +++ b/src/make.rc @@ -45,6 +45,11 @@ rm -f ./runtime/runtime_defs.go # Determine the host compiler toolchain. eval `{grep '^(CC|LD|O)=' /$objtype/mkfile} +# cgo is not generally supported on 1.4. +# Disable unless explicitly requested. +if(~ $CGO_ENABLED '') + CGO_ENABLED = 0 + echo '# Building C bootstrap tool.' echo cmd/dist GOROOT = `{cd .. && pwd} |