When using the go tool with gccgo, we can't check for whether the standard packages are up to date, because we can't assume that the source code is available. And we can't read runtime/internal/sys/zversion.go, because that too is not generally available. This was fixed in the gc repository with https://golang.org/cl/33295. This patch simply brings that change over to gccgo. This fixes GCC PR 77910. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 242715) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -7593cc83a03999331c5e2dc65a9306c5fe57dfd0 +e66f30e862cb5d02b9d55bf44ac439bb8fc4ea19 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/cmd/go/pkg.go =================================================================== --- libgo/go/cmd/go/pkg.go (revision 242581) +++ libgo/go/cmd/go/pkg.go (working copy) @@ -523,6 +523,11 @@ func disallowInternal(srcDir string, p * return p } + // We can't check standard packages with gccgo. + if buildContext.Compiler == "gccgo" && p.Standard { + return p + } + // The stack includes p.ImportPath. // If that's the only thing on the stack, we started // with a name given on the command line, not an @@ -1588,7 +1593,7 @@ func computeBuildID(p *Package) { // Include the content of runtime/internal/sys/zversion.go in the hash // for package runtime. This will give package runtime a // different build ID in each Go release. - if p.Standard && p.ImportPath == "runtime/internal/sys" { + if p.Standard && p.ImportPath == "runtime/internal/sys" && buildContext.Compiler != "gccgo" { data, err := ioutil.ReadFile(filepath.Join(p.Dir, "zversion.go")) if err != nil { fatalf("go: %s", err)