Skip to content

Commit d2c1263

Browse files
eliasnaurbradfitz
authored andcommitted
cmd/dist: don't generate exec wrappers for compatible cross compiles
This change will allow android/arm64 hosts to build for android/arm, and likewise for iOS. Updates #31722 Change-Id: Id410bd112abbab585ebb13b61fe4d3a38a1a81fb Reviewed-on: https://go-review.googlesource.com/c/go/+/174705 Run-TryBot: Elias Naur <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent f03b333 commit d2c1263

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/cmd/dist/build.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,14 +1425,15 @@ func cmdbootstrap() {
14251425
}
14261426

14271427
func wrapperPathFor(goos, goarch string) string {
1428-
if goos == gohostos && goarch == gohostarch {
1429-
return ""
1430-
}
14311428
switch {
14321429
case goos == "android":
1433-
return pathf("%s/misc/android/go_android_exec.go", goroot)
1430+
if gohostos != "android" {
1431+
return pathf("%s/misc/android/go_android_exec.go", goroot)
1432+
}
14341433
case goos == "darwin" && (goarch == "arm" || goarch == "arm64"):
1435-
return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
1434+
if gohostos != "darwin" || (gohostarch != "arm" && gohostarch != "arm64") {
1435+
return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
1436+
}
14361437
}
14371438
return ""
14381439
}

0 commit comments

Comments
 (0)