[llvm] 0beeadf - [ORC] Link `atomic` on platforms without hardware support for atomics.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 21:15:27 PDT 2023
Author: Owen Shepherd
Date: 2023-04-11T04:15:21Z
New Revision: 0beeadf2035766a1b73bd2aae1df39585e586a5c
URL: https://github.com/llvm/llvm-project/commit/0beeadf2035766a1b73bd2aae1df39585e586a5c
DIFF: https://github.com/llvm/llvm-project/commit/0beeadf2035766a1b73bd2aae1df39585e586a5c.diff
LOG: [ORC] Link `atomic` on platforms without hardware support for atomics.
Fixes error about missing reference to __atomic_fetch_add_8 when linking
LLVMOrcJit on ARMv6.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D147937
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
index 1d4c14625a3e6..1055e316cc733 100644
--- a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
@@ -1,3 +1,7 @@
+if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+ set (atomic_lib atomic)
+endif()
+
if( CMAKE_HOST_UNIX AND HAVE_LIBRT )
set(rt_lib rt)
endif()
@@ -53,6 +57,7 @@ add_llvm_component_library(LLVMOrcJIT
LINK_LIBS
${LLVM_PTHREAD_LIB}
${rt_lib}
+ ${atomic_lib}
LINK_COMPONENTS
Core
More information about the llvm-commits
mailing list