From: Nikhil Benesch Date: Sat, 2 Feb 2019 17:35:44 +0000 (-0500) Subject: cmd/go: include AR env var in gccgo build IDs X-Git-Tag: go1.13beta1~591 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=213d1cf3ca9fb8e5013927f76eb753c0f588174e;p=gostls13.git cmd/go: include AR env var in gccgo build IDs The gccgo toolchain uses the archiver specified by the AR environment variable, or `ar` by default. Teach the build ID to take the value of this environment variable into account, since different archivers can produce different results. Fix #30046. Change-Id: Ia6821258d54eecedb9026afc38a515cd564c45cb Reviewed-on: https://go-review.googlesource.com/c/go/+/160897 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 5d2659cef5..87ca5f3128 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -8,6 +8,11 @@ package work import ( "bytes" + "cmd/go/internal/base" + "cmd/go/internal/cache" + "cmd/go/internal/cfg" + "cmd/go/internal/load" + "cmd/go/internal/str" "encoding/json" "errors" "fmt" @@ -25,12 +30,6 @@ import ( "strings" "sync" "time" - - "cmd/go/internal/base" - "cmd/go/internal/cache" - "cmd/go/internal/cfg" - "cmd/go/internal/load" - "cmd/go/internal/str" ) // actionList returns the list of actions in the dag rooted at root @@ -270,6 +269,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { } fmt.Fprintf(h, "compile %s %q %q\n", id, forcedGccgoflags, p.Internal.Gccgoflags) fmt.Fprintf(h, "pkgpath %s\n", gccgoPkgpath(p)) + fmt.Fprintf(h, "ar %q\n", BuildToolchain.(gccgoToolchain).ar()) if len(p.SFiles) > 0 { id, _ = b.gccgoToolID(BuildToolchain.compiler(), "assembler-with-cpp") // Ignore error; different assembler versions