mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "cmd/go: disable cgo by default if CC unset and DefaultCC doesn't exist"
This reverts commit c2d85eb999.
Reason for revert: change was incorrect. ignores setting of CGO_ENABLED in some cases
Change-Id: I8e6e68dd600be5306a247a3314f4b57175f1aa56
Reviewed-on: https://go-review.googlesource.com/c/go/+/705495
Auto-Submit: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Ian Alexander <jitsu@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
ee7bf06cb3
commit
51dc5bfe6c
1 changed files with 1 additions and 2 deletions
|
|
@ -145,8 +145,7 @@ func defaultContext() build.Context {
|
||||||
if buildcfg.DefaultCGO_ENABLED == "1" {
|
if buildcfg.DefaultCGO_ENABLED == "1" {
|
||||||
defaultCgoEnabled = true
|
defaultCgoEnabled = true
|
||||||
} else if buildcfg.DefaultCGO_ENABLED == "0" {
|
} 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)
|
defaultCgoEnabled = platform.CgoSupported(ctxt.GOOS, ctxt.GOARCH)
|
||||||
// Use built-in default cgo setting for GOOS/GOARCH.
|
// Use built-in default cgo setting for GOOS/GOARCH.
|
||||||
// Note that ctxt.GOOS/GOARCH are derived from the preference list
|
// Note that ctxt.GOOS/GOARCH are derived from the preference list
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue