Commit 213d1cf3 authored by Nikhil Benesch's avatar Nikhil Benesch Committed by Brad Fitzpatrick

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 <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent d92bc7a5
...@@ -8,6 +8,11 @@ package work ...@@ -8,6 +8,11 @@ package work
import ( import (
"bytes" "bytes"
"cmd/go/internal/base"
"cmd/go/internal/cache"
"cmd/go/internal/cfg"
"cmd/go/internal/load"
"cmd/go/internal/str"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
...@@ -25,12 +30,6 @@ import ( ...@@ -25,12 +30,6 @@ import (
"strings" "strings"
"sync" "sync"
"time" "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 // actionList returns the list of actions in the dag rooted at root
...@@ -270,6 +269,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { ...@@ -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, "compile %s %q %q\n", id, forcedGccgoflags, p.Internal.Gccgoflags)
fmt.Fprintf(h, "pkgpath %s\n", gccgoPkgpath(p)) fmt.Fprintf(h, "pkgpath %s\n", gccgoPkgpath(p))
fmt.Fprintf(h, "ar %q\n", BuildToolchain.(gccgoToolchain).ar())
if len(p.SFiles) > 0 { if len(p.SFiles) > 0 {
id, _ = b.gccgoToolID(BuildToolchain.compiler(), "assembler-with-cpp") id, _ = b.gccgoToolID(BuildToolchain.compiler(), "assembler-with-cpp")
// Ignore error; different assembler versions // Ignore error; different assembler versions
......
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