Skip to content

Commit 60629d1

Browse files
[release/10.0] Mark labels in x64 write barrier code as local/alt_entry (#120923)
Backport of #119245 to release/10.0 /cc @agocke @filipnavara ## Customer Impact - [ ] Customer reported - [X] Found internally [Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.] ## Regression - [X] Yes - [ ] No This is a regression in the new Apple toolset. ## Testing Tested manually, and in macios CI. ## Risk Medium, product change coming somewhat late. However, this change has been running in the `main` branch for a couple weeks with no issue. --------- Co-authored-by: Filip Navara <[email protected]>
1 parent e055281 commit 60629d1

File tree

8 files changed

+217
-94
lines changed

8 files changed

+217
-94
lines changed

eng/native/configurecompiler.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ if (CLR_CMAKE_HOST_UNIX)
3434
endif()
3535
endif()
3636

37+
# Force usage of classic linker on Xcode 15
38+
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND
39+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15 AND
40+
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
41+
add_link_options("-Wl,-ld_classic")
42+
endif()
43+
3744
if (CMAKE_CONFIGURATION_TYPES) # multi-configuration generator?
3845
set(CMAKE_CONFIGURATION_TYPES "Debug;Checked;Release;RelWithDebInfo" CACHE STRING "" FORCE)
3946
endif (CMAKE_CONFIGURATION_TYPES)

src/coreclr/pal/inc/unixasmmacrosamd64.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ C_FUNC(\Name):
5353
.endm
5454

5555
.macro LEAF_END_MARKED Name, Section
56-
C_FUNC(\Name\()_End):
56+
#if defined(__APPLE__)
57+
.alt_entry C_FUNC(\Name\()_End)
58+
.private_extern C_FUNC(\Name\()_End)
59+
#else
5760
.global C_FUNC(\Name\()_End)
61+
#endif
62+
C_FUNC(\Name\()_End):
5863
LEAF_END \Name, \Section
5964
// make sure this symbol gets its own address
6065
nop

src/coreclr/pal/inc/unixasmmacrosarm64.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@ C_FUNC(\Name):
6464
.endm
6565

6666
.macro LEAF_END_MARKED Name, Section
67-
C_FUNC(\Name\()_End):
67+
#if defined(__APPLE__)
68+
.alt_entry C_FUNC(\Name\()_End)
69+
.private_extern C_FUNC(\Name\()_End)
70+
#else
6871
.global C_FUNC(\Name\()_End)
72+
#endif
73+
C_FUNC(\Name\()_End):
6974
LEAF_END \Name, \Section
7075
// make sure this symbol gets its own address
7176
nop

src/coreclr/vm/amd64/CachedInterfaceDispatchCoreCLR.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LEAF_ENTRY RhpVTableOffsetDispatch, _TEXT
2323
// to get the address in the vtable chunk list of what we want to dereference
2424
#ifdef TARGET_APPLE
2525
// Apple's linker has issues which break unwind info if
26-
// an ALTERNATE_ENTRY is present in the middle of a function see https://github.com/dotnet/runtime/pull/114982#discussion_r2083272768
26+
// an ALTERNATE_ENTRY is present in the middle of a function see https://github.com/dotnet/runtime/issues/119005
2727
.cfi_endproc
2828
#endif
2929
ALTERNATE_ENTRY RhpVTableOffsetDispatchAVLocation

0 commit comments

Comments
 (0)