Index: unittests/ExecutionEngine/Orc/CMakeLists.txt =================================================================== --- unittests/ExecutionEngine/Orc/CMakeLists.txt +++ unittests/ExecutionEngine/Orc/CMakeLists.txt @@ -24,4 +24,9 @@ SymbolStringPoolTest.cpp ) -target_link_libraries(OrcJITTests PRIVATE ${LLVM_PTHREAD_LIB}) +set(ORC_JIT_TEST_LIBS ${LLVM_PTHREAD_LIB}) +if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) + list(APPEND ORC_JIT_TEST_LIBS atomic) +endif() + +target_link_libraries(OrcJITTests PRIVATE ${ORC_JIT_TEST_LIBS})