summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-05-21 08:21:09 -0700
committerKhem Raj <raj.khem@gmail.com>2023-09-08 09:08:54 -0700
commit5dcfe6b343bfcaac86567ff128a75953a4f6b598 (patch)
tree1c6fc81c435231a457ff40c897420bee5f4044fe
parent04a07650fc2f28935ff08985aea634ce05a4633d (diff)
downloadmeta-clang-5dcfe6b343bfcaac86567ff128a75953a4f6b598.tar.gz
compiler-rt-sanitizers: Fix build on mips
Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 85c1247d641e8f3286151cf77c8a888955a4fbb1)
-rw-r--r--recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch29
-rw-r--r--recipes-devtools/clang/common.inc1
2 files changed, 30 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch
new file mode 100644
index 0000000..6289e8b
--- /dev/null
+++ b/recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch
@@ -0,0 +1,29 @@
1From b7247e617cef1ed277c17bf0970104ccf55c5d92 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 21 May 2021 08:14:29 -0700
4Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips
5
6clang on mips generate atomic built-ins which should be provided by
7libatomic
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
16index 572ad078423f..8e5c0eaad211 100644
17--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt
18+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
19@@ -131,6 +131,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS)
20
21 append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS)
22
23+if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
24+ list(APPEND SCUDO_LINK_LIBS atomic)
25+endif()
26+
27 if(COMPILER_RT_HAS_SCUDO_STANDALONE)
28 add_compiler_rt_object_libraries(RTScudoStandalone
29 ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index e69acff..8046c35 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -40,6 +40,7 @@ SRC_URI = "\
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 file://0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \
43 file://0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \
43 file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \ 44 file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \
44 file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \ 45 file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \
45" 46"