mirror of
https://github.com/golang/go.git
synced 2026-02-02 17:05:05 +03:00
cmd/go: disable cgo by default if CC unset and DefaultCC doesn't exist
CL 621995 disrupted the behavior introduced by CL 450739, now restore it. Fixes #75340 Change-Id: Icd1a0eb970876995f9446e0547ceb9e78990f6ed Reviewed-on: https://go-review.googlesource.com/c/go/+/703555 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com> Reviewed-by: Ian Alexander <jitsu@google.com> Reviewed-by: Sean Liao <sean@liao.dev>
This commit is contained in:
committed by
Michael Matloob
parent
ac82fe68aa
commit
c2d85eb999
@@ -145,7 +145,8 @@ func defaultContext() build.Context {
|
||||
if buildcfg.DefaultCGO_ENABLED == "1" {
|
||||
defaultCgoEnabled = true
|
||||
} else if buildcfg.DefaultCGO_ENABLED == "0" {
|
||||
} else if runtime.GOARCH == ctxt.GOARCH && runtime.GOOS == ctxt.GOOS {
|
||||
}
|
||||
if runtime.GOARCH == ctxt.GOARCH && runtime.GOOS == ctxt.GOOS {
|
||||
defaultCgoEnabled = platform.CgoSupported(ctxt.GOOS, ctxt.GOARCH)
|
||||
// Use built-in default cgo setting for GOOS/GOARCH.
|
||||
// Note that ctxt.GOOS/GOARCH are derived from the preference list
|
||||
|
||||
Reference in New Issue
Block a user