Index: lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt =================================================================== --- lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt +++ lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt @@ -1,3 +1,11 @@ +# Ignore undef of __register_frame / __deregister_frame +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # TODO: see if -rtlib flag exists in CMAKE_SHARED_LINKER_FLAGS, then get + # output of -print-libgcc-file-name, do removal only when output is + # compiler-rt. + string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") +endif() + add_llvm_library(LLVMRuntimeDyld JITSymbol.cpp RTDyldMemoryManager.cpp Index: unittests/Support/DynamicLibrary/CMakeLists.txt =================================================================== --- unittests/Support/DynamicLibrary/CMakeLists.txt +++ unittests/Support/DynamicLibrary/CMakeLists.txt @@ -19,6 +19,9 @@ PipSqueak.cpp ) set_target_properties(${NAME} PROPERTIES FOLDER "Tests") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_link_libraries(${NAME} PRIVATE gcc_s) + endif() set_output_directory(${NAME} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}