cmd/link: update machoPlatform selection

Now that we have darwin/arm64 and ios/arm64 ports, make it based
on GOOS, instead of GOARCH.

Also drop a remaining case of 32-bit ARM.

Change-Id: I954fff980712fd3b81b561ddcb6f3a4ef73fa0b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/312549
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2021-04-21 19:02:11 -04:00
parent a4f3ff2205
commit b2a032add8

View File

@ -468,9 +468,12 @@ func (ctxt *Link) domacho() {
}
}
if machoPlatform == 0 {
machoPlatform = PLATFORM_MACOS
if buildcfg.GOOS == "ios" {
machoPlatform = PLATFORM_IOS
}
switch ctxt.Arch.Family {
default:
machoPlatform = PLATFORM_MACOS
if ctxt.LinkMode == LinkInternal {
// For lldb, must say LC_VERSION_MIN_MACOSX or else
// it won't know that this Mach-O binary is from OS X
@ -486,8 +489,7 @@ func (ctxt *Link) domacho() {
ml.data[0] = 10<<16 | 9<<8 | 0<<0 // OS X version 10.9.0
ml.data[1] = 10<<16 | 9<<8 | 0<<0 // SDK 10.9.0
}
case sys.ARM, sys.ARM64:
machoPlatform = PLATFORM_IOS
case sys.ARM64:
}
}