[PATCH] D92530: [compiler-rt] [builtins] Make lse.S compile on Darwin
Kuba (Brecka) Mracek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 17:30:26 PST 2020
kubamracek created this revision.
kubamracek added reviewers: arphaman, steven_wu, ilinpv.
Herald added subscribers: Sanitizers, jfb, dberris.
Herald added a project: Sanitizers.
kubamracek requested review of this revision.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92530
Files:
compiler-rt/lib/builtins/aarch64/lse.S
compiler-rt/lib/builtins/assembly.h
Index: compiler-rt/lib/builtins/assembly.h
===================================================================
--- compiler-rt/lib/builtins/assembly.h
+++ compiler-rt/lib/builtins/assembly.h
@@ -27,7 +27,13 @@
#define FILE_LEVEL_DIRECTIVE .subsections_via_symbols
#define SYMBOL_IS_FUNC(name)
#define CONST_SECTION .const
-
+#if defined(__arm__) || defined(__aarch64__)
+#define FUNC_ALIGN \
+ .text SEPARATOR \
+ .balign 16 SEPARATOR
+#else
+#define FUNC_ALIGN
+#endif
#define NO_EXEC_STACK_DIRECTIVE
#elif defined(__ELF__)
Index: compiler-rt/lib/builtins/aarch64/lse.S
===================================================================
--- compiler-rt/lib/builtins/aarch64/lse.S
+++ compiler-rt/lib/builtins/aarch64/lse.S
@@ -102,8 +102,13 @@
// Macro for branch to label if no LSE available
.macro JUMP_IF_NOT_LSE label
+#if !defined(__APPLE__)
adrp x(tmp0), __aarch64_have_lse_atomics
ldrb w(tmp0), [x(tmp0), :lo12:__aarch64_have_lse_atomics]
+#else
+ adrp x(tmp0), __aarch64_have_lse_atomics at page
+ ldrb w(tmp0), [x(tmp0), __aarch64_have_lse_atomics at pageoff]
+#endif
cbz w(tmp0), \label
.endm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92530.309115.patch
Type: text/x-patch
Size: 1293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201203/d592475f/attachment.bin>
More information about the llvm-commits
mailing list