diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt --- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt @@ -138,8 +138,19 @@ ) set(SCUDO_OBJECT_LIBS) +set(SCUDO_LINK_LIBS) if (COMPILER_RT_HAS_GWP_ASAN) + if(COMPILER_RT_USE_LLVM_UNWINDER) + list(APPEND SCUDO_LINK_LIBS ${COMPILER_RT_UNWINDER_LINK_LIBS} dl) + elseif (COMPILER_RT_HAS_GCC_S_LIB) + list(APPEND SCUDO_LINK_LIBS gcc_s) + elseif (COMPILER_RT_HAS_GCC_LIB) + list(APPEND SCUDO_LINK_LIBS gcc) + else() + message(FATAL_ERROR "No suitable unwinder library") + endif() + add_dependencies(scudo_standalone gwp_asan) list(APPEND SCUDO_OBJECT_LIBS RTGwpAsan RTGwpAsanBacktraceLibc RTGwpAsanSegvHandler @@ -152,8 +163,6 @@ endif() -set(SCUDO_LINK_LIBS ${COMPILER_RT_UNWINDER_LINK_LIBS}) - if(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC) include_directories(${COMPILER_RT_BINARY_DIR}/../libc/include/)