1
0
mirror of https://github.com/golang/go synced 2024-11-07 11:36:11 -07:00

cmd/dist: add needCC comment, fix needCC

This was missed in CL 475377.

Change-Id: I4e8c4c0459a92029a3f448c1e4172d3343280c57
Reviewed-on: https://go-review.googlesource.com/c/go/+/475958
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
This commit is contained in:
Russ Cox 2023-03-13 13:14:35 -04:00
parent 40a6e2dae5
commit 8b3dc5399d

View File

@ -1742,8 +1742,10 @@ var firstClass = map[string]bool{
"windows/amd64": true, "windows/amd64": true,
} }
// We only need CC if cgo is forced on, or if the platform requires external linking.
// Otherwise the go command will automatically disable it.
func needCC() bool { func needCC() bool {
return os.Getenv("CGO_ENABLED") == "1" return os.Getenv("CGO_ENABLED") == "1" || mustLinkExternal(gohostos, gohostarch, false)
} }
func checkCC() { func checkCC() {