diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-05-19 21:53:25 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-06-08 11:37:54 -0700 |
commit | 241e7e50d394795822beb04869fa540026ebf0cd (patch) | |
tree | 30a5de0c446434549572dcf852da25b3dbce6c1d | |
parent | 6ecc0989f152811b8e042d0eb0c94db24c023543 (diff) | |
download | meta-clang-241e7e50d394795822beb04869fa540026ebf0cd.tar.gz |
compiler-rt-sanitizers: Link with static C++ runtime when available
This fixes build on ARM
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
2 files changed, 29 insertions, 0 deletions
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 @@ | |||
1 | From 24ce3255ade936fee508d83c7f2551c8f2142bac Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 19 May 2021 21:49:18 -0700 | ||
4 | Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES | ||
5 | |||
6 | If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this | ||
7 | fixes build time errors like | ||
8 | |||
9 | projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': | ||
10 | | sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | compiler-rt/lib/scudo/CMakeLists.txt | 1 + | ||
15 | 1 file changed, 1 insertion(+) | ||
16 | |||
17 | diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt | ||
18 | index e580d6d1408b..c14d7636e291 100644 | ||
19 | --- a/compiler-rt/lib/scudo/CMakeLists.txt | ||
20 | +++ b/compiler-rt/lib/scudo/CMakeLists.txt | ||
21 | @@ -12,6 +12,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) | ||
22 | append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) | ||
23 | append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) | ||
24 | append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) | ||
25 | +append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) | ||
26 | append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer | ||
27 | SCUDO_CFLAGS) | ||
28 | |||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index d0811fc..35553a1 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -39,6 +39,7 @@ SRC_URI = "\ | |||
39 | file://0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ | 39 | file://0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ |
40 | file://0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ | 40 | file://0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ |
41 | file://0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ | 41 | file://0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ |
42 | file://0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ | ||
42 | " | 43 | " |
43 | # Fallback to no-PIE if not set | 44 | # Fallback to no-PIE if not set |
44 | GCCPIE ??= "" | 45 | GCCPIE ??= "" |