[PATCH] D106305: [compiler-rt][CMake] create aarch64 helper asm during configure time

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 13:24:27 PDT 2021


steven_wu created this revision.
steven_wu added reviewers: tambre, ilinpv, thakis, ikudrin.
Herald added subscribers: danielkiss, ributzka, kristof.beyls, mgorny, dberris.
steven_wu requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

When using cmake Makefile generator, the helper asm is going to be
generated multiple times for every supported aarch64 architectures and
it is going cause race conditions when those commands are running at the
same time. Fix by moving asm helper generation to configuration time
since it only involves copy/create_symlink existing files.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106305

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
@@ -531,8 +531,7 @@
     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}
+        execute_process(
           COMMAND ${CMAKE_COMMAND} -E ${COMPILER_RT_LINK_OR_COPY} "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}"
         )
         set_source_files_properties("${helper_asm}"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106305.359893.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/08cc35fe/attachment.bin>


More information about the llvm-commits mailing list