Skip to content

Commit

Permalink
compiler-rt-sanitizers: Fix build on mips
Browse files Browse the repository at this point in the history
Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Jun 8, 2021
1 parent 6a442a8 commit 85c1247
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From b7247e617cef1ed277c17bf0970104ccf55c5d92 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 May 2021 08:14:29 -0700
Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips

clang on mips generate atomic built-ins which should be provided by
libatomic

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
index 572ad078423f..8e5c0eaad211 100644
--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt
+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
@@ -131,6 +131,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS)

append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS)

+if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
+ list(APPEND SCUDO_LINK_LIBS atomic)
+endif()
+
if(COMPILER_RT_HAS_SCUDO_STANDALONE)
add_compiler_rt_object_libraries(RTScudoStandalone
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
1 change: 1 addition & 0 deletions recipes-devtools/clang/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ SRC_URI = "\
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://0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \
file://0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \
"
# Fallback to no-PIE if not set
GCCPIE ??= ""
Expand Down

0 comments on commit 85c1247

Please sign in to comment.