From 43f1ea3102edc881cf97cd0b93316a1010d90567 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 19 May 2021 21:53:25 -0700 Subject: compiler-rt-sanitizers: Link with static C++ runtime when available This fixes build on ARM Signed-off-by: Khem Raj (cherry picked from commit 241e7e50d394795822beb04869fa540026ebf0cd) --- ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 ++++++++++++++++++++++ ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 ---------------------- recipes-devtools/clang/common.inc | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch delete mode 100644 recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch diff --git a/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch new file mode 100644 index 0000000..7da132a --- /dev/null +++ b/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -0,0 +1,28 @@ +From 24ce3255ade936fee508d83c7f2551c8f2142bac Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 21:49:18 -0700 +Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES + +If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this +fixes build time errors like + +projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': +| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt +index e580d6d1408b..c14d7636e291 100644 +--- a/compiler-rt/lib/scudo/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/CMakeLists.txt +@@ -12,6 +12,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) ++append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer + SCUDO_CFLAGS) + diff --git a/recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch deleted file mode 100644 index e95b418..0000000 --- a/recipes-devtools/clang/clang/0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 08c592b1850c9b0c17a9f4163e93682a9f83d7f7 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 21:49:18 -0700 -Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES - -If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this -fixes build time errors like - -projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': -| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt -index c50ea0233fae..ddc1128b8ed8 100644 ---- a/compiler-rt/lib/scudo/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/CMakeLists.txt -@@ -12,6 +12,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) -+append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer - SCUDO_CFLAGS) - diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index e37c459..e69acff 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -39,7 +39,7 @@ SRC_URI = "\ file://0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ file://0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ file://0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \ file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \ " -- cgit v1.2.3-54-g00ecf