From e1e972689b9138db795885a5468a15aafbe7cb51 Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Fri, 27 Jan 2023 18:34:00 +0000 Subject: [PATCH] Reland "[compiler-rt] Fix scudo build on ARM" This reverts commit 5abef0bdbe9237b5728215bb7cd915ffb960e5c3 and fixes Fuchsia AArch64 cross-compile. --- compiler-rt/lib/scudo/standalone/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt index b2f4ff8..0f9a483 100644 --- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt @@ -137,8 +137,19 @@ set(SCUDO_SOURCES_CXX_WRAPPERS ) 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) + elseif (NOT COMPILER_RT_USE_BUILTINS_LIBRARY) + message(FATAL_ERROR "No suitable unwinder library") + endif() + add_dependencies(scudo_standalone gwp_asan) list(APPEND SCUDO_OBJECT_LIBS RTGwpAsan RTGwpAsanBacktraceLibc RTGwpAsanSegvHandler @@ -151,8 +162,6 @@ if (COMPILER_RT_HAS_GWP_ASAN) 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/) -- 2.7.4