diff options
author | 2021-03-06 11:45:57 +0200 | |
---|---|---|
committer | 2021-03-08 20:16:33 -0800 | |
commit | 15d1ee36720ff24323f55452ae3cfb63f318c3f3 (patch) | |
tree | 8f6b54d435f232cb630487c57599b800e848ae26 | |
parent | [TargetLowering] Use HandleSDNodes to prevent nodes from being deleted by rec... (diff) | |
download | llvm-project-15d1ee36720ff24323f55452ae3cfb63f318c3f3.tar.gz llvm-project-15d1ee36720ff24323f55452ae3cfb63f318c3f3.tar.bz2 llvm-project-15d1ee36720ff24323f55452ae3cfb63f318c3f3.zip |
[CMake][compiler-rt] Use copying instead of symlinking for LSE builtins on non-Unix-likesllvmorg-12.0.0-rc3
As reported in D93278 post-review symlinking requires privilege escalation on Windows.
Copying is functionally same, so fallback to it for systems that aren't Unix-like.
This is similar to the solution in AddLLVM.cmake.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D98111
(cherry picked from commit ba860963b156db3b653c67ef044df877f3cea9cc)
-rw-r--r-- | compiler-rt/lib/builtins/CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index b511a9a987b3..73b6bead8424 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -515,6 +515,12 @@ set(aarch64_SOURCES set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir") file(MAKE_DIRECTORY "${OA_HELPERS_DIR}") +if(CMAKE_HOST_UNIX) + set(COMPILER_RT_LINK_OR_COPY create_symlink) +else() + set(COMPILER_RT_LINK_OR_COPY copy) +endif() + foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) foreach(model 1 2 3 4) @@ -522,7 +528,7 @@ foreach(pat cas swp ldadd ldclr ldeor ldset) set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") add_custom_command( OUTPUT ${helper_asm} - COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" + COMMAND ${CMAKE_COMMAND} -E ${COMPILER_RT_LINK_OR_COPY} "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" ) set_source_files_properties("${helper_asm}" PROPERTIES |