]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: update machoPlatform selection
authorCherry Zhang <cherryyz@google.com>
Wed, 21 Apr 2021 23:02:11 +0000 (19:02 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 22 Apr 2021 14:34:36 +0000 (14:34 +0000)
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>
src/cmd/link/internal/ld/macho.go

index 98c9a32f4dcc338a45546abb33c27dbda28b588c..1c88c05dd4af7a70ac1830a2dec809ad66a76dd5 100644 (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:
                }
        }