1
0
mirror of https://github.com/golang/go synced 2024-11-25 00:07:56 -07:00

cmd/go: support -compiler for go list, fix isStale for gccgo.

Fixes #3228.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784044
This commit is contained in:
Rémy Oudompheng 2012-03-07 23:15:55 +01:00
parent c8b1f85493
commit 5c4d6ebb11
2 changed files with 3 additions and 2 deletions

View 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, "")

View 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
}