aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm/compiler-rt-0002-musl-no-sanitizers.patch
blob: 433895a3b8795017507de30d3073c81d2604bafb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From c6a6b4cd6b6516aa01595292086d53f9e47ca599 Mon Sep 17 00:00:00 2001
From: Travis Tilley <ttilley@gmail.com>
Date: Sat, 9 May 2015 04:17:45 -0400
Subject: [PATCH 2/2] dont build sanitizers on musl. they currently require too
 many extensions to compile.

---
 cmake/config-ix.cmake |  4 +++-
 lib/Makefile.mk       | 15 ++++++++-------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index f6d48b3..26b6d8e 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -186,13 +186,15 @@ filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64
 filter_available_targets(TSAN_SUPPORTED_ARCH x86_64)
 filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips mipsel mips64 mips64el)
 
+string(REGEX MATCH "musl[^-]*$" LLVM_ENV_MUSL ${LLVM_HOST_TRIPLE})
+
 if(ANDROID)
   set(OS_NAME "Android")
 else()
   set(OS_NAME "${CMAKE_SYSTEM_NAME}")
 endif()
 
-if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
+if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND NOT LLVM_ENV_MUSL AND
     (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR
     (OS_NAME MATCHES "Windows" AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)))
   set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
diff --git a/lib/Makefile.mk b/lib/Makefile.mk
index ed9690d..28e17d9 100644
--- a/lib/Makefile.mk
+++ b/lib/Makefile.mk
@@ -10,13 +10,14 @@
 SubDirs :=
 
 # Add submodules.
-SubDirs += asan
+#SubDirs += asan
 SubDirs += builtins
-SubDirs += dfsan
+#SubDirs += dfsan
 SubDirs += interception
-SubDirs += lsan
-SubDirs += msan
+#SubDirs += lsan
+#SubDirs += msan
 SubDirs += profile
-SubDirs += sanitizer_common
-SubDirs += tsan
-SubDirs += ubsan
+#SubDirs += sanitizer_common
+#SubDirs += tsan
+#SubDirs += ubsan
+
-- 
2.1.4