Skip to content

Commit

Permalink
cmd/link: Add missing platform for Mac Catalyst
Browse files Browse the repository at this point in the history
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: feae982
GitHub-Pull-Request: #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>
  • Loading branch information
cplepage authored and cherrymui committed May 9, 2024
1 parent dd6dee4 commit cecbf4f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/cmd/link/internal/ld/macho.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cecbf4f

Please sign in to comment.