[PATCH] D92549: [compiler-rt] Fix building the aarch64 out-of-line atomics assembly for non-ELF platforms

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 00:38:07 PST 2020


mstorsjo created this revision.
mstorsjo added reviewers: ilinpv, danielkiss, t.p.northover.
Herald added subscribers: Sanitizers, kristof.beyls, dberris.
Herald added a project: Sanitizers.
mstorsjo requested review of this revision.

Move the two different definitions of FUNC_ALIGN out of the ELF specific block. Add the missing CFI_END in the non-ELF version of END_COMPILERRT_OUTLINE_FUNCTION, to go with the corresponding CFI_START in DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92549

Files:
  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
@@ -37,12 +37,8 @@
 #define FILE_LEVEL_DIRECTIVE
 #if defined(__arm__) || defined(__aarch64__)
 #define SYMBOL_IS_FUNC(name) .type name,%function
-#define FUNC_ALIGN                                                             \
-  .text SEPARATOR                                                              \
-  .balign 16 SEPARATOR
 #else
 #define SYMBOL_IS_FUNC(name) .type name, at function
-#define FUNC_ALIGN
 #endif
 #define CONST_SECTION .section .rodata
 
@@ -69,6 +65,14 @@
 
 #endif
 
+#if defined(__arm__) || defined(__aarch64__)
+#define FUNC_ALIGN                                                             \
+  .text SEPARATOR                                                              \
+  .balign 16 SEPARATOR
+#else
+#define FUNC_ALIGN
+#endif
+
 // BTI and PAC gnu property note
 #define NT_GNU_PROPERTY_TYPE_0 5
 #define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000
@@ -270,7 +274,8 @@
   .size SYMBOL_NAME(name), . - SYMBOL_NAME(name)
 #else
 #define END_COMPILERRT_FUNCTION(name)
-#define END_COMPILERRT_OUTLINE_FUNCTION(name)
+#define END_COMPILERRT_OUTLINE_FUNCTION(name)                                  \
+  CFI_END
 #endif
 
 #endif // COMPILERRT_ASSEMBLY_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92549.309176.patch
Type: text/x-patch
Size: 1377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201203/156f7f99/attachment.bin>


More information about the llvm-commits mailing list