Commit d2c12634 authored by Elias Naur's avatar Elias Naur Committed by Brad Fitzpatrick

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 <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent f03b3331
...@@ -1425,14 +1425,15 @@ func cmdbootstrap() { ...@@ -1425,14 +1425,15 @@ func cmdbootstrap() {
} }
func wrapperPathFor(goos, goarch string) string { func wrapperPathFor(goos, goarch string) string {
if goos == gohostos && goarch == gohostarch {
return ""
}
switch { switch {
case goos == "android": case goos == "android":
return pathf("%s/misc/android/go_android_exec.go", goroot) if gohostos != "android" {
return pathf("%s/misc/android/go_android_exec.go", goroot)
}
case goos == "darwin" && (goarch == "arm" || goarch == "arm64"): case goos == "darwin" && (goarch == "arm" || goarch == "arm64"):
return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot) if gohostos != "darwin" || (gohostarch != "arm" && gohostarch != "arm64") {
return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
}
} }
return "" return ""
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment