Skip to content

Commit 41e66d3

Browse files
authored
[release/8.0] Fix compilation of runtime with Xcode 16 (#112208)
* Add missing .alt_entry to CoreCLR *_FakeProlog methods * Use .alt_entry on Apple platforms * Remove explicit __compact_unwind entries from x64 assembler
1 parent 2f4a700 commit 41e66d3

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

src/coreclr/nativeaot/Runtime/unix/unixasmmacrosamd64.inc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@
1616

1717
.macro NESTED_END Name, Section
1818
LEAF_END \Name, \Section
19-
#if defined(__APPLE__)
20-
.set LOCAL_LABEL(\Name\()_Size), . - C_FUNC(\Name)
21-
.section __LD,__compact_unwind,regular,debug
22-
.quad C_FUNC(\Name)
23-
.long LOCAL_LABEL(\Name\()_Size)
24-
.long 0x04000000 # DWARF
25-
.quad 0
26-
.quad 0
27-
#endif
2819
.endm
2920

3021
.macro PATCH_LABEL Name
@@ -33,7 +24,12 @@ C_FUNC(\Name):
3324
.endm
3425

3526
.macro ALTERNATE_ENTRY Name
27+
#if defined(__APPLE__)
28+
.alt_entry C_FUNC(\Name)
29+
.private_extern C_FUNC(\Name)
30+
#else
3631
.global C_FUNC(\Name)
32+
#endif
3733
C_FUNC(\Name):
3834
.endm
3935

src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm64.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ C_FUNC(\Name):
2424
.endm
2525

2626
.macro ALTERNATE_ENTRY Name
27+
#if defined(__APPLE__)
28+
.alt_entry C_FUNC(\Name)
29+
.private_extern C_FUNC(\Name)
30+
#else
2731
.global C_FUNC(\Name)
28-
#if !defined(__APPLE__)
2932
.hidden C_FUNC(\Name)
3033
#endif
3134
C_FUNC(\Name):

src/coreclr/pal/inc/unixasmmacrosamd64.inc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414

1515
.macro NESTED_END Name, Section
1616
LEAF_END \Name, \Section
17-
#if defined(__APPLE__)
18-
.set LOCAL_LABEL(\Name\()_Size), . - C_FUNC(\Name)
19-
.section __LD,__compact_unwind,regular,debug
20-
.quad C_FUNC(\Name)
21-
.long LOCAL_LABEL(\Name\()_Size)
22-
.long 0x04000000 # DWARF
23-
.quad 0
24-
.quad 0
25-
#endif
2617
.endm
2718

2819
.macro PATCH_LABEL Name

src/coreclr/pal/inc/unixasmmacrosarm64.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
.endm
1818

1919
.macro PATCH_LABEL Name
20+
#if defined(__APPLE__)
21+
.alt_entry C_FUNC(\Name)
22+
.private_extern C_FUNC(\Name)
23+
#else
2024
.global C_FUNC(\Name)
25+
#endif
2126
C_FUNC(\Name):
2227
.endm
2328

src/coreclr/vm/arm64/asmhelpers.S

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ NESTED_END ThePreStub, _TEXT
169169

170170
LEAF_ENTRY ThePreStubPatch, _TEXT
171171
nop
172-
.globl C_FUNC(ThePreStubPatchLabel)
173-
C_FUNC(ThePreStubPatchLabel):
172+
PATCH_LABEL ThePreStubPatchLabel
174173
ret lr
175174
LEAF_END ThePreStubPatch, _TEXT
176175

@@ -818,8 +817,12 @@ NESTED_END ResolveWorkerAsmStub, _TEXT
818817
#ifdef FEATURE_READYTORUN
819818

820819
NESTED_ENTRY DelayLoad_MethodCall_FakeProlog, _TEXT, NoHandler
821-
C_FUNC(DelayLoad_MethodCall):
820+
#if defined(__APPLE__)
821+
.alt_entry C_FUNC(DelayLoad_MethodCall)
822+
#endif
822823
.global C_FUNC(DelayLoad_MethodCall)
824+
C_FUNC(DelayLoad_MethodCall):
825+
823826
PROLOG_WITH_TRANSITION_BLOCK
824827

825828
add x0, sp, #__PWTB_TransitionBlock // pTransitionBlock
@@ -838,8 +841,11 @@ NESTED_END DelayLoad_MethodCall_FakeProlog, _TEXT
838841

839842
.macro DynamicHelper frameFlags, suffix
840843
NESTED_ENTRY DelayLoad_Helper\suffix\()_FakeProlog, _TEXT, NoHandler
841-
C_FUNC(DelayLoad_Helper\suffix):
844+
#if defined(__APPLE__)
845+
.alt_entry C_FUNC(DelayLoad_Helper\suffix)
846+
#endif
842847
.global C_FUNC(DelayLoad_Helper\suffix)
848+
C_FUNC(DelayLoad_Helper\suffix):
843849

844850
PROLOG_WITH_TRANSITION_BLOCK
845851

0 commit comments

Comments
 (0)