aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-07-12 11:19:16 -0600
committerBrad Fitzpatrick <bradfitz@golang.org>2016-07-12 19:18:08 +0000
commita1110c39301b21471c27dad0e50cdbe499587fc8 (patch)
treea74cec86a0280b8dc3ade48555b4c604cf070e91
parentb30814bbd6840e1574a27c87c37515af22caa5d9 (diff)
downloadgo-a1110c39301b21471c27dad0e50cdbe499587fc8.tar.gz
go-a1110c39301b21471c27dad0e50cdbe499587fc8.zip
cmd/go: don't fail on invalid GOOS/GOARCH pair when using gccgo
Fixes #12272 Change-Id: I0306ce0ef4a87df2158df3b7d4d8d93a1cb6dabc Reviewed-on: https://go-review.googlesource.com/24864 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/cmd/go/build.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
index 11a4eab093..3c0b994ef2 100644
--- a/src/cmd/go/build.go
+++ b/src/cmd/go/build.go
@@ -673,11 +673,6 @@ func init() {
goarch = buildContext.GOARCH
goos = buildContext.GOOS
- if _, ok := osArchSupportsCgo[goos+"/"+goarch]; !ok {
- fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", goos, goarch)
- os.Exit(2)
- }
-
if goos == "windows" {
exeSuffix = ".exe"
}
@@ -1226,6 +1221,11 @@ func allArchiveActions(root *action) []*action {
// do runs the action graph rooted at root.
func (b *builder) do(root *action) {
+ if _, ok := osArchSupportsCgo[goos+"/"+goarch]; !ok && buildContext.Compiler == "gc" {
+ fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", goos, goarch)
+ os.Exit(2)
+ }
+
// Build list of all actions, assigning depth-first post-order priority.
// The original implementation here was a true queue
// (using a channel) but it had the effect of getting