aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-09-22 10:30:45 -0700
committerIan Lance Taylor <iant@golang.org>2017-09-22 17:50:28 +0000
commitd76c7d5a31ffaba3134f16981abd5f891fa2d805 (patch)
treea63842b71fc6e3f340d58c42a792bef8127f8d3e
parenta3310f9981ac6916a1c03ec9ac84ee023cb7d8ed (diff)
downloadgo-d76c7d5a31ffaba3134f16981abd5f891fa2d805.tar.gz
go-d76c7d5a31ffaba3134f16981abd5f891fa2d805.zip
[release-branch.go1.4] go/build: don't enable cgo for any system by default
The 1.4 branch is now used only for building more recent releases. Enabling cgo is not required for that, and tends to cause problems as systems and compilers change. Updates #21054 Change-Id: I498f493e3ac32bcea55725cf5de3b3172f0fd5db Reviewed-on: https://go-review.googlesource.com/65450 Reviewed-by: Joe Tsai <joetsai@google.com> Run-TryBot: Joe Tsai <joetsai@google.com>
-rw-r--r--src/go/build/build.go25
-rwxr-xr-xsrc/make.bash1
2 files changed, 4 insertions, 22 deletions
diff --git a/src/go/build/build.go b/src/go/build/build.go
index 311ecb01f4..c532549cd7 100644
--- a/src/go/build/build.go
+++ b/src/go/build/build.go
@@ -256,28 +256,9 @@ func (ctxt *Context) SrcDirs() []string {
// if set, or else the compiled code's GOARCH, GOOS, and GOROOT.
var Default Context = defaultContext()
-var cgoEnabled = map[string]bool{
- "darwin/386": true,
- "darwin/amd64": true,
- "dragonfly/386": true,
- "dragonfly/amd64": true,
- "freebsd/386": true,
- "freebsd/amd64": true,
- "freebsd/arm": true,
- "linux/386": true,
- "linux/amd64": true,
- "linux/arm": true,
- "android/386": true,
- "android/amd64": true,
- "android/arm": true,
- "netbsd/386": true,
- "netbsd/amd64": true,
- "netbsd/arm": true,
- "openbsd/386": true,
- "openbsd/amd64": true,
- "windows/386": true,
- "windows/amd64": true,
-}
+// On the 1.4 branch, cgo is not enabled by default for any system.
+// Set CGO_ENABLED=1 when running make.bash to enable cgo.
+var cgoEnabled = map[string]bool{}
func defaultContext() Context {
var c Context
diff --git a/src/make.bash b/src/make.bash
index fbc6f5d89d..104c3ba5fb 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -29,6 +29,7 @@
# CGO_ENABLED: Controls cgo usage during the build. Set it to 1
# to include all cgo related files, .c and .go file with "cgo"
# build directive, in the build. Set it to 0 to ignore them.
+# The default for this release is 0.
#
# GO_EXTLINK_ENABLED: Set to 1 to invoke the host linker when building
# packages that use cgo. Set to 0 to do all linking internally. This