Skip to content

Commit

Permalink
[release/9.0] Fix compilation of runtime with Xcode 16 (#106800)
Browse files Browse the repository at this point in the history
* Add missing .alt_entry to CoreCLR *_FakeProlog methods

* Use .alt_entry on Apple platforms
  • Loading branch information
filipnavara authored Aug 22, 2024
1 parent 81af315 commit 562efd6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/coreclr/nativeaot/Runtime/unix/unixasmmacrosamd64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ C_FUNC(\Name):
.endm

.macro ALTERNATE_ENTRY Name
#if defined(__APPLE__)
.alt_entry C_FUNC(\Name)
.private_extern C_FUNC(\Name)
#else
.global C_FUNC(\Name)
#endif
C_FUNC(\Name):
.endm

Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ C_FUNC(\Name):
.endm

.macro ALTERNATE_ENTRY Name
#if defined(__APPLE__)
.alt_entry C_FUNC(\Name)
.private_extern C_FUNC(\Name)
#else
.global C_FUNC(\Name)
#if !defined(__APPLE__)
.hidden C_FUNC(\Name)
#endif
C_FUNC(\Name):
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/pal/inc/unixasmmacrosarm64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
.endm

.macro PATCH_LABEL Name
#if defined(__APPLE__)
.alt_entry C_FUNC(\Name)
.private_extern C_FUNC(\Name)
#else
.global C_FUNC(\Name)
#endif
C_FUNC(\Name):
.endm

Expand Down
14 changes: 10 additions & 4 deletions src/coreclr/vm/arm64/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ NESTED_END ThePreStub, _TEXT

LEAF_ENTRY ThePreStubPatch, _TEXT
nop
.globl C_FUNC(ThePreStubPatchLabel)
C_FUNC(ThePreStubPatchLabel):
PATCH_LABEL ThePreStubPatchLabel
ret lr
LEAF_END ThePreStubPatch, _TEXT

Expand Down Expand Up @@ -607,8 +606,12 @@ NESTED_END ResolveWorkerAsmStub, _TEXT
#ifdef FEATURE_READYTORUN

NESTED_ENTRY DelayLoad_MethodCall_FakeProlog, _TEXT, NoHandler
C_FUNC(DelayLoad_MethodCall):
#if defined(__APPLE__)
.alt_entry C_FUNC(DelayLoad_MethodCall)
#endif
.global C_FUNC(DelayLoad_MethodCall)
C_FUNC(DelayLoad_MethodCall):

PROLOG_WITH_TRANSITION_BLOCK

add x0, sp, #__PWTB_TransitionBlock // pTransitionBlock
Expand All @@ -627,8 +630,11 @@ NESTED_END DelayLoad_MethodCall_FakeProlog, _TEXT

.macro DynamicHelper frameFlags, suffix
NESTED_ENTRY DelayLoad_Helper\suffix\()_FakeProlog, _TEXT, NoHandler
C_FUNC(DelayLoad_Helper\suffix):
#if defined(__APPLE__)
.alt_entry C_FUNC(DelayLoad_Helper\suffix)
#endif
.global C_FUNC(DelayLoad_Helper\suffix)
C_FUNC(DelayLoad_Helper\suffix):

PROLOG_WITH_TRANSITION_BLOCK

Expand Down

0 comments on commit 562efd6

Please sign in to comment.