summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-15 18:05:24 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-15 18:05:24 +0000
commitd0bb767200641883bf0f3939c7fcb8357b1bafdf (patch)
tree8af89ab078186cd821f1f9f1f9f076eb166050db
parent532322d3883478c66425443314d5dbe764497a16 (diff)
downloadgcc-d0bb767200641883bf0f3939c7fcb8357b1bafdf.tar.gz
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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239486 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/go/cmd/go/pkg.go7
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 16beba1d843..e6a0f8483f5 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-24e0c4c98e0614b1892316aca787f1c564f2d269
+affb1bf5fcd7abf05993c54313d8000b93a08d4a
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/go/cmd/go/pkg.go b/libgo/go/cmd/go/pkg.go
index 6d5d97f5c07..d1292a132d2 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)