]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: support -compiler for go list, fix isStale for gccgo.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 7 Mar 2012 22:15:55 +0000 (23:15 +0100)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 7 Mar 2012 22:15:55 +0000 (23:15 +0100)
Fixes #3228.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784044

src/cmd/go/list.go
src/cmd/go/pkg.go

index 99a87040211db575d01dbc69ae29b203671e030b..446e2304bed94e5df864e03a77b65655b036a6b9 100644 (file)
@@ -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, "")
index 5878d8f71ef5a996f0bb531a535d372aa422e4be..09d84e5f27da25fb0755cca0c8e3db06a2736de7 100644 (file)
@@ -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
        }