Skip to content

Commit a1110c3

Browse files
committed
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 <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent b30814b commit a1110c3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cmd/go/build.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,6 @@ func init() {
673673
goarch = buildContext.GOARCH
674674
goos = buildContext.GOOS
675675

676-
if _, ok := osArchSupportsCgo[goos+"/"+goarch]; !ok {
677-
fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", goos, goarch)
678-
os.Exit(2)
679-
}
680-
681676
if goos == "windows" {
682677
exeSuffix = ".exe"
683678
}
@@ -1226,6 +1221,11 @@ func allArchiveActions(root *action) []*action {
12261221

12271222
// do runs the action graph rooted at root.
12281223
func (b *builder) do(root *action) {
1224+
if _, ok := osArchSupportsCgo[goos+"/"+goarch]; !ok && buildContext.Compiler == "gc" {
1225+
fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", goos, goarch)
1226+
os.Exit(2)
1227+
}
1228+
12291229
// Build list of all actions, assigning depth-first post-order priority.
12301230
// The original implementation here was a true queue
12311231
// (using a channel) but it had the effect of getting

0 commit comments

Comments
 (0)