Skip to content

Commit

Permalink
[release/8.0] Fix compilation of runtime with Xcode 16 (#112208)
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

* Remove explicit __compact_unwind entries from x64 assembler
  • Loading branch information
filipnavara authored Feb 5, 2025
1 parent 2f4a700 commit 41e66d3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
14 changes: 5 additions & 9 deletions src/coreclr/nativeaot/Runtime/unix/unixasmmacrosamd64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

.macro NESTED_END Name, Section
LEAF_END \Name, \Section
#if defined(__APPLE__)
.set LOCAL_LABEL(\Name\()_Size), . - C_FUNC(\Name)
.section __LD,__compact_unwind,regular,debug
.quad C_FUNC(\Name)
.long LOCAL_LABEL(\Name\()_Size)
.long 0x04000000 # DWARF
.quad 0
.quad 0
#endif
.endm

.macro PATCH_LABEL Name
Expand All @@ -33,7 +24,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
9 changes: 0 additions & 9 deletions src/coreclr/pal/inc/unixasmmacrosamd64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@

.macro NESTED_END Name, Section
LEAF_END \Name, \Section
#if defined(__APPLE__)
.set LOCAL_LABEL(\Name\()_Size), . - C_FUNC(\Name)
.section __LD,__compact_unwind,regular,debug
.quad C_FUNC(\Name)
.long LOCAL_LABEL(\Name\()_Size)
.long 0x04000000 # DWARF
.quad 0
.quad 0
#endif
.endm

.macro PATCH_LABEL 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 @@ -169,8 +169,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 @@ -818,8 +817,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 @@ -838,8 +841,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 41e66d3

Please sign in to comment.