diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-23 20:11:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-23 20:11:27 +0000 |
commit | 0f0d0eaae5e0b07dd5a08be93ba0009b1146cf76 (patch) | |
tree | 40e13137824ad16c1f451051269e4dc808569ded /libgo/go | |
parent | 8845cb377abb4e2ede6cc5c1a6bc635d71063fd2 (diff) | |
download | gcc-0f0d0eaae5e0b07dd5a08be93ba0009b1146cf76.zip gcc-0f0d0eaae5e0b07dd5a08be93ba0009b1146cf76.tar.gz gcc-0f0d0eaae5e0b07dd5a08be93ba0009b1146cf76.tar.bz2 |
cmd/go: don't require GOROOT to exist for gccgo
Reviewed-on: https://go-review.googlesource.com/46590
From-SVN: r249609
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/cmd/go/main.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/go/cmd/go/main.go b/libgo/go/cmd/go/main.go index d80ff2d..ceeac4d 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. |