Skip to content

Commit 01a6ba8

Browse files
authored
Merge pull request #9310 from compnerd/arm64-darwin-lse
builtins: repair the Darwin build for ARM64
2 parents 18561a6 + 76df208 commit 01a6ba8

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)