]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: Add missing platform for Mac Catalyst
authorCP Lepage <32472542+cplepage@users.noreply.github.com>
Tue, 7 May 2024 12:35:25 +0000 (12:35 +0000)
committerCherry Mui <cherryyz@google.com>
Thu, 9 May 2024 17:45:45 +0000 (17:45 +0000)
Fixes #67175

Defines a MachoPlatorm constant in OS_Darwin for MacCatalyst build. This enables adding the suffix $INODE64 on syscall methods needed for amd64 Darwin platform.

Change-Id: Ie677e241599e2a14359c5809fa9ddb3b63161629
GitHub-Last-Rev: feae982e682d5b0479fe1c7eccdc423dc4bf2ea4
GitHub-Pull-Request: golang/go#67176
Reviewed-on: https://go-review.googlesource.com/c/go/+/583295
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/link/internal/ld/macho.go

index 91e908c97fd33a6b1f14abccd89d7cc8c48546b6..33d44a3becde7e01a6bf5fe9e46bf987d0632986 100644 (file)
@@ -195,11 +195,12 @@ const (
 )
 
 const (
-       PLATFORM_MACOS    MachoPlatform = 1
-       PLATFORM_IOS      MachoPlatform = 2
-       PLATFORM_TVOS     MachoPlatform = 3
-       PLATFORM_WATCHOS  MachoPlatform = 4
-       PLATFORM_BRIDGEOS MachoPlatform = 5
+       PLATFORM_MACOS          MachoPlatform = 1
+       PLATFORM_IOS            MachoPlatform = 2
+       PLATFORM_TVOS           MachoPlatform = 3
+       PLATFORM_WATCHOS        MachoPlatform = 4
+       PLATFORM_BRIDGEOS       MachoPlatform = 5
+       PLATFORM_MACCATALYST    MachoPlatform = 6
 )
 
 // rebase table opcode
@@ -969,7 +970,7 @@ func collectmachosyms(ctxt *Link) {
                // Some 64-bit functions have a "$INODE64" or "$INODE64$UNIX2003" suffix.
                if t == sym.SDYNIMPORT && ldr.SymDynimplib(s) == "/usr/lib/libSystem.B.dylib" {
                        // But only on macOS.
-                       if machoPlatform == PLATFORM_MACOS {
+                       if machoPlatform == PLATFORM_MACOS || machoPlatform == PLATFORM_MACCATALYST {
                                switch n := ldr.SymExtname(s); n {
                                case "fdopendir":
                                        switch buildcfg.GOARCH {