Commit 5c4d6ebb authored by Rémy Oudompheng's avatar Rémy Oudompheng

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
parent c8b1f854
......@@ -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, "")
......
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment