diff --git a/src/cmd/go/list.go b/src/cmd/go/list.go index 99a87040211db575d01dbc69ae29b203671e030b..446e2304bed94e5df864e03a77b65655b036a6b9 100644 --- a/src/cmd/go/list.go +++ b/src/cmd/go/list.go @@ -86,6 +86,7 @@ For more about specifying packages, see 'go help packages'. func init() { cmdList.Run = runList // break init cycle + cmdList.Flag.Var(buildCompiler{}, "compiler", "") } var listE = cmdList.Flag.Bool("e", false, "") diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index 5878d8f71ef5a996f0bb531a535d372aa422e4be..09d84e5f27da25fb0755cca0c8e3db06a2736de7 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -372,7 +372,7 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package } // unsafe is a fake package. - if p.Standard && p.ImportPath == "unsafe" { + if p.Standard && (p.ImportPath == "unsafe" || buildContext.Compiler == "gccgo") { p.target = "" } @@ -417,7 +417,7 @@ func computeStale(pkgs ...*Package) { // isStale reports whether package p needs to be rebuilt. func isStale(p *Package, topRoot map[string]bool) bool { - if p.Standard && p.ImportPath == "unsafe" { + if p.Standard && (p.ImportPath == "unsafe" || buildContext.Compiler == "gccgo") { // fake, builtin package return false }