]> Cypherpunks repositories - gostls13.git/commit
cmd/go: don't clobber `go env GOGCCFLAGS`
authorIan Lance Taylor <iant@golang.org>
Tue, 15 Nov 2016 22:48:54 +0000 (14:48 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 22 Nov 2016 04:27:49 +0000 (04:27 +0000)
commite9ffda45c8b7d409a5b951d6a74b8241c026fad5
tree2588d14ebcae784d5b931a68743d5d9475d433cf
parent6f31abd23a6f768c21c8b308f355f3a1bae521d2
cmd/go: don't clobber `go env GOGCCFLAGS`

When CC is set in the environment, the mkEnv function sets its version
of CC to the first word $CC and sets GOGCCFLAGS to the remainder. That
worked since Go 1 but was broken accidentally by
https://golang.org/cl/6409, which changed the code such that `go env`
calls mkEnv twice. The second call to mkEnv would clobber GOGCCFLAGS
based on the value of CC set by the first call. Go back to the old
handling by only calling mkEnv once.

Fixes #15457.

Change-Id: I000a1ebcc48684667e48f2b9b24605867b9e06cd
Reviewed-on: https://go-review.googlesource.com/33293
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/bug.go
src/cmd/go/env.go
src/cmd/go/go_test.go
src/cmd/go/main.go