From: ian Date: Fri, 23 Jun 2017 20:11:27 +0000 (+0000) Subject: cmd/go: don't require GOROOT to exist for gccgo X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=299d0f2388f98b2ba607e60a2bc9908b83fcc933;p=thirdparty%2Fgcc.git cmd/go: don't require GOROOT to exist for gccgo Reviewed-on: https://go-review.googlesource.com/46590 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249609 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index eb58bbd2ae0c..e2d91ad222c4 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -c49ba1ca392b3c23a4b3934e0a95a908b1dc2f1d +fc0cfdff94ca1099421900f43837ca5a70189cd6 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/main.go b/libgo/go/cmd/go/main.go index d80ff2da5fe6..ceeac4d4a3a8 100644 --- a/libgo/go/cmd/go/main.go +++ b/libgo/go/cmd/go/main.go @@ -155,8 +155,13 @@ func main() { } if fi, err := os.Stat(goroot); err != nil || !fi.IsDir() { - fmt.Fprintf(os.Stderr, "go: cannot find GOROOT directory: %v\n", goroot) - os.Exit(2) + // For gccgo this is fine, carry on. + // Note that this check is imperfect as we have not yet + // parsed the -compiler flag. + if runtime.Compiler != "gccgo" { + fmt.Fprintf(os.Stderr, "go: cannot find GOROOT directory: %v\n", goroot) + os.Exit(2) + } } // Set environment (GOOS, GOARCH, etc) explicitly.