[PATCH] D92836: [AArch64] don't build out of line atomics on Darwin or Windows

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 04:37:20 PST 2020


t.p.northover created this revision.
t.p.northover added a reviewer: ilinpv.
Herald added subscribers: danielkiss, jfb, kristof.beyls, mgorny, mcrosier.
t.p.northover requested review of this revision.

The `lse.S` file uses syntax that only works on ELF targets (e.g. `:lo12`), so it prevents building compiler-rt for iOS and ARM-based macOS.


https://reviews.llvm.org/D92836

Files:
  compiler-rt/lib/builtins/CMakeLists.txt


Index: compiler-rt/lib/builtins/CMakeLists.txt
===================================================================
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -516,26 +516,28 @@
 set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir")
 file(MAKE_DIRECTORY ${OA_HELPERS_DIR})
 
-foreach(pat cas swp ldadd ldclr ldeor ldset)
-  foreach(size 1 2 4 8 16)
-    foreach(model 1 2 3 4)
-      if(pat STREQUAL "cas" OR NOT size STREQUAL "16")
-        set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S)
-        add_custom_command(
-          OUTPUT ${helper_asm}
-          COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model}
-                  ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm}
-          DEPENDS aarch64/lse.S assembly.h
-        )
-        set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE)
-        set(aarch64_SOURCES
-          ${aarch64_SOURCES}
-          ${helper_asm}
-        )
-      endif()
-    endforeach(model)
-  endforeach(size)
-endforeach(pat)
+if(NOT APPLE AND NOT WIN32)
+  foreach(pat cas swp ldadd ldclr ldeor ldset)
+    foreach(size 1 2 4 8 16)
+      foreach(model 1 2 3 4)
+        if(pat STREQUAL "cas" OR NOT size STREQUAL "16")
+          set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S)
+          add_custom_command(
+            OUTPUT ${helper_asm}
+            COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model}
+                    ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm}
+            DEPENDS aarch64/lse.S assembly.h
+          )
+          set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE)
+          set(aarch64_SOURCES
+            ${aarch64_SOURCES}
+            ${helper_asm}
+          )
+        endif()
+      endforeach(model)
+    endforeach(size)
+  endforeach(pat)
+endif()
 
 if (MINGW)
   set(aarch64_SOURCES


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92836.310140.patch
Type: text/x-patch
Size: 2028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201208/4a918363/attachment.bin>


More information about the llvm-commits mailing list