Skip to content

Commit 76df208

Browse files
committed
builtins: repair the Darwin build for ARM64
The addressing mode for the ADR/ADRP is different on Darwin than on other platforms. Restore the Darwin specific path to allow building on this platform.
1 parent b867e31 commit 76df208

File tree

1 file changed

+5
-0
lines changed
  • compiler-rt/lib/builtins/aarch64

1 file changed

+5
-0
lines changed

compiler-rt/lib/builtins/aarch64/lse.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,13 @@ HIDDEN(SYMBOL_NAME(__aarch64_have_lse_atomics))
127127

128128
// Macro for branch to label if no LSE available
129129
.macro JUMP_IF_NOT_LSE label
130+
#if defined(__APPLE__)
131+
adrp x(tmp0), SYMBOL_NAME(__aarch64_have_lse_atomics)@page
132+
ldrb w(tmp0), [x(tmp0), SYMBOL_NAME(__aarch64_have_lse_atomics)@pageoff]
133+
#else
130134
adrp x(tmp0), SYMBOL_NAME(__aarch64_have_lse_atomics)
131135
ldrb w(tmp0), [x(tmp0), :lo12:SYMBOL_NAME(__aarch64_have_lse_atomics)]
136+
#endif
132137
cbz w(tmp0), \label
133138
.endm
134139

0 commit comments

Comments
 (0)