]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: don't check standard packages when using gccgo
authorIan Lance Taylor <iant@golang.org>
Wed, 16 Nov 2016 00:15:05 +0000 (16:15 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 21 Nov 2016 22:06:23 +0000 (22:06 +0000)
The gccgo compiler does not have the standard packages available, so it
can not check for violations of internal references.

Also, the gccgo compiler can not read runtime/internal/sys/zversion.go;
in fact, the file does not even exist for gccgo.

Change-Id: Ibadf16b371621ad1b87b6e858c5eb233913e179d
Reviewed-on: https://go-review.googlesource.com/33295
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/pkg.go

index 064a428703b08f7b2fd7807f3e9772b5d920e005..8b31d2f64d3308d35017c5291c86cff85d577143 100644 (file)
@@ -586,6 +586,11 @@ func disallowInternal(srcDir string, p *Package, stk *importStack) *Package {
                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
@@ -1634,7 +1639,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)