summaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2019-01-14 09:45:49 +0000
committerDiana Picus <diana.picus@linaro.org>2019-01-14 09:45:49 +0000
commit4cea29391a7edb34efc665b0edc04e2710c90c4f (patch)
tree8177aafd376f72cb92c3c28b47e8fe418930c51a /compiler-rt
parent655001f3e07e7c8dd7fe06cee1bc93ff43c2dd3d (diff)
[asan] Add fallback for Thumb after r350139
This reverts r350806 which marked some tests as UNSUPPORTED on ARM and instead reintroduces the old code path only for Thumb, since that seems to be the only target that broke. It would still be nice to find the root cause of the breakage, but with the branch point for LLVM 8.0 scheduled for next week it's better to put things in a stable state while we investigate. Differential Revision: https://reviews.llvm.org/D56594
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc11
-rw-r--r--compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc2
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc2
3 files changed, 13 insertions, 2 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc
index 2a790e851f1..13344f3b888 100644
--- a/compiler-rt/lib/asan/asan_rtl.cc
+++ b/compiler-rt/lib/asan/asan_rtl.cc
@@ -383,12 +383,18 @@ void PrintAddressSpaceLayout() {
kHighShadowBeg > kMidMemEnd);
}
+#if defined(__thumb__) && defined(__linux__)
+#define START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
+#endif
+
+#ifndef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
static bool UNUSED __local_asan_dyninit = [] {
MaybeStartBackgroudThread();
SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
return false;
}();
+#endif
static void AsanInitInternal() {
if (LIKELY(asan_inited)) return;
@@ -464,6 +470,11 @@ static void AsanInitInternal() {
allocator_options.SetFrom(flags(), common_flags());
InitializeAllocator(allocator_options);
+#ifdef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
+ MaybeStartBackgroudThread();
+ SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
+#endif
+
// On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
// should be set to 1 prior to initializing the threads.
asan_inited = 1;
diff --git a/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc b/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc
index 75a96ffd188..f7bccbfbe8d 100644
--- a/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc
+++ b/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc
@@ -7,7 +7,7 @@
// RUN: %env_asan_opts=hard_rss_limit_mb=20 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT
// https://github.com/google/sanitizers/issues/981
-// UNSUPPORTED: android-26, arm
+// UNSUPPORTED: android-26
#include <string.h>
char *g;
diff --git a/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc b/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc
index ed213036f98..e01d416cb80 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc
+++ b/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc
@@ -16,7 +16,7 @@
// XFAIL: msan
// XFAIL: ubsan
-// UNSUPPORTED: freebsd, solaris, darwin, arm
+// UNSUPPORTED: freebsd, solaris, darwin
#include <string.h>
#include <stdio.h>