Commit a46ea907 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

go/build: don't alter InstallSuffix for default compile options

Fixes #16378.

Change-Id: I99a064f1afec78fb63cb3719061d20be0f21d45d
Reviewed-on: https://go-review.googlesource.com/24930
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 87061054
...@@ -43,7 +43,7 @@ func run(t *testing.T, msg string, args ...string) { ...@@ -43,7 +43,7 @@ func run(t *testing.T, msg string, args ...string) {
} }
// goCmd invokes the go tool with the installsuffix set up by TestMain. It calls // goCmd invokes the go tool with the installsuffix set up by TestMain. It calls
// t.Errorf if the command fails. // t.Fatalf if the command fails.
func goCmd(t *testing.T, args ...string) { func goCmd(t *testing.T, args ...string) {
newargs := []string{args[0], "-installsuffix=" + suffix} newargs := []string{args[0], "-installsuffix=" + suffix}
if testing.Verbose() { if testing.Verbose() {
...@@ -63,7 +63,7 @@ func goCmd(t *testing.T, args ...string) { ...@@ -63,7 +63,7 @@ func goCmd(t *testing.T, args ...string) {
} }
if err != nil { if err != nil {
if t != nil { if t != nil {
t.Errorf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output) t.Fatalf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output)
} else { } else {
log.Fatalf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output) log.Fatalf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output)
} }
......
...@@ -431,10 +431,13 @@ func buildModeInit() { ...@@ -431,10 +431,13 @@ func buildModeInit() {
buildAsmflags = append(buildAsmflags, codegenArg) buildAsmflags = append(buildAsmflags, codegenArg)
buildGcflags = append(buildGcflags, codegenArg) buildGcflags = append(buildGcflags, codegenArg)
} }
if buildContext.InstallSuffix != "" { // Don't alter InstallSuffix when modifying default codegen args.
buildContext.InstallSuffix += "_" if buildBuildmode != "default" || buildLinkshared {
if buildContext.InstallSuffix != "" {
buildContext.InstallSuffix += "_"
}
buildContext.InstallSuffix += codegenArg[1:]
} }
buildContext.InstallSuffix += codegenArg[1:]
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment