diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-08-15 18:05:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-08-15 18:05:24 +0000 |
commit | 87155d4f6c847cd072321424831fd0ffb405265d (patch) | |
tree | 8af89ab078186cd821f1f9f1f9f076eb166050db /libgo/go | |
parent | 2008be405c16e8b7ca5399fb9e6fb25aa92f03a3 (diff) | |
download | gcc-87155d4f6c847cd072321424831fd0ffb405265d.zip gcc-87155d4f6c847cd072321424831fd0ffb405265d.tar.gz gcc-87155d4f6c847cd072321424831fd0ffb405265d.tar.bz2 |
cmd/go: ignore errors from go/build for standard packages
The go/build package does not know that gccgo's standard packages don't
have source, and will report an error saying that it can not find them.
Work around that in the cmd/go sources, since the go/build sources don't
currently have a list of standard packages.
This should get a real fix in the master sources, somehow.
Fixes golang/go#16701.
Reviewed-on: https://go-review.googlesource.com/27052
From-SVN: r239486
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/cmd/go/pkg.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/pkg.go b/libgo/go/cmd/go/pkg.go index 6d5d97f..d1292a1 100644 --- a/libgo/go/cmd/go/pkg.go +++ b/libgo/go/cmd/go/pkg.go @@ -763,6 +763,13 @@ var cgoSyscallExclude = map[string]bool{ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package { p.copyBuild(bp) + // When using gccgo the go/build package will not be able to + // find a standard package. It would be nicer to not get that + // error, but go/build doesn't know stdpkg. + if runtime.Compiler == "gccgo" && err != nil && p.Standard { + err = nil + } + // The localPrefix is the path we interpret ./ imports relative to. // Synthesized main packages sometimes override this. p.localPrefix = dirToImportPath(p.Dir) |