Skip to content

Commit cecbf4f

Browse files
cplepagecherrymui
authored andcommitted
cmd/link: Add missing platform for Mac Catalyst
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>
1 parent dd6dee4 commit cecbf4f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/cmd/link/internal/ld/macho.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ const (
195195
)
196196

197197
const (
198-
PLATFORM_MACOS MachoPlatform = 1
199-
PLATFORM_IOS MachoPlatform = 2
200-
PLATFORM_TVOS MachoPlatform = 3
201-
PLATFORM_WATCHOS MachoPlatform = 4
202-
PLATFORM_BRIDGEOS MachoPlatform = 5
198+
PLATFORM_MACOS MachoPlatform = 1
199+
PLATFORM_IOS MachoPlatform = 2
200+
PLATFORM_TVOS MachoPlatform = 3
201+
PLATFORM_WATCHOS MachoPlatform = 4
202+
PLATFORM_BRIDGEOS MachoPlatform = 5
203+
PLATFORM_MACCATALYST MachoPlatform = 6
203204
)
204205

205206
// rebase table opcode
@@ -969,7 +970,7 @@ func collectmachosyms(ctxt *Link) {
969970
// Some 64-bit functions have a "$INODE64" or "$INODE64$UNIX2003" suffix.
970971
if t == sym.SDYNIMPORT && ldr.SymDynimplib(s) == "/usr/lib/libSystem.B.dylib" {
971972
// But only on macOS.
972-
if machoPlatform == PLATFORM_MACOS {
973+
if machoPlatform == PLATFORM_MACOS || machoPlatform == PLATFORM_MACCATALYST {
973974
switch n := ldr.SymExtname(s); n {
974975
case "fdopendir":
975976
switch buildcfg.GOARCH {

0 commit comments

Comments
 (0)