summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2020-11-04 22:27:35 -0800
committerVitaly Buka <vitalybuka@google.com>2020-11-04 22:29:09 -0800
commit2d041554d1f94abed3ddd396d8af944acf63fe4e (patch)
tree5dca7d63b3ca9ca67401d7a2784db0f19d91845f
parentae38540042668675dd16c642d850115f217ea59f (diff)
downloadllvm-2d041554d1f94abed3ddd396d8af944acf63fe4e.tar.gz
[LSAN] Fix preprocessor condition for MSVC
-rw-r--r--compiler-rt/lib/lsan/lsan_common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler-rt/lib/lsan/lsan_common.h b/compiler-rt/lib/lsan/lsan_common.h
index a26a8b37aa0b..da5d2318144f 100644
--- a/compiler-rt/lib/lsan/lsan_common.h
+++ b/compiler-rt/lib/lsan/lsan_common.h
@@ -29,10 +29,14 @@
// To enable LeakSanitizer on a new architecture, one needs to implement the
// internal_clone function as well as (probably) adjust the TLS machinery for
// the new architecture inside the sanitizer library.
+#if SANITIZER_ANDROID
// Exclude leak-detection on arm32 for Android because `__aeabi_read_tp`
// is missing. This caused a link error.
-#if SANITIZER_ANDROID && (__ANDROID_API__ < 28 || defined(__arm__))
+#if (__ANDROID_API__ < 28 || defined(__arm__))
#define CAN_SANITIZE_LEAKS 0
+#else
+#define CAN_SANITIZE_LEAKS 1
+#endif
#elif (SANITIZER_LINUX || SANITIZER_MAC) && (SANITIZER_WORDSIZE == 64) && \
(defined(__x86_64__) || defined(__mips64) || defined(__aarch64__) || \
defined(__powerpc64__) || defined(__s390x__))