Index: compiler-rt/CMakeLists.txt =================================================================== --- compiler-rt/CMakeLists.txt +++ compiler-rt/CMakeLists.txt @@ -129,6 +129,7 @@ if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$") if (${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "^arm") set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf") + CHECK_SYMBOL_EXISTS (__thumb__ "" COMPILER_RT_ARM_THUMB) endif() endif() if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*android.*") Index: compiler-rt/lib/sanitizer_common/sanitizer_platform.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -197,8 +197,12 @@ #if defined(__arm__) # define SANITIZER_ARM 1 +# ifdef __thumb__ +# define SANITIZER_ARM_THUMB 1 +# endif #else # define SANITIZER_ARM 0 +# define SANITIZER_ARM_THUMB 0 #endif #if SANITIZER_SOLARIS && SANITIZER_WORDSIZE == 32 @@ -318,7 +322,7 @@ // pthread_exit() performs unwinding that leads to dlopen'ing libgcc_s.so. // dlopen mallocs "libgcc_s.so" string which confuses LSan, it fails to realize // that this allocation happens in dynamic linker and should be ignored. -#if SANITIZER_PPC || defined(__thumb__) +#if SANITIZER_PPC || SANITIZER_ARM_THUMB # define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 1 #else # define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0 Index: compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h +++ compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h @@ -22,6 +22,8 @@ #if SANITIZER_LINUX && defined(__mips__) # define SANITIZER_CAN_FAST_UNWIND 0 +#elif SANITIZER_LINUX && !SANITIZER_ANDROID && SANITIZER_ARM_THUMB +# define SANITIZER_CAN_FAST_UNWIND 0 #elif SANITIZER_WINDOWS # define SANITIZER_CAN_FAST_UNWIND 0 #elif SANITIZER_OPENBSD Index: compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cpp =================================================================== --- compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cpp +++ compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cpp @@ -1,10 +1,10 @@ // Test quarantine_size_mb (and the deprecated quarantine_size) // RUN: %clangxx_asan %s -o %t -// RUN: %env_asan_opts=quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 -// RUN: %env_asan_opts=quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 -// RUN: %env_asan_opts=quarantine_size_mb=10:quarantine_size=20:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=BOTH -// RUN: %env_asan_opts=quarantine_size_mb=1000:hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT -// RUN: %env_asan_opts=hard_rss_limit_mb=20 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT +// RUN: %env_asan_opts=quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50:fast_unwind_on_malloc=0 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 +// RUN: %env_asan_opts=quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50:fast_unwind_on_malloc=0 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 +// RUN: %env_asan_opts=quarantine_size_mb=10:quarantine_size=20:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=BOTH +// RUN: %env_asan_opts=quarantine_size_mb=1000:hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT +// 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 Index: compiler-rt/test/asan/lit.cfg.py =================================================================== --- compiler-rt/test/asan/lit.cfg.py +++ compiler-rt/test/asan/lit.cfg.py @@ -191,7 +191,7 @@ config.available_features.add("asan-" + config.bits + "-bits") # Fast unwinder doesn't work with Thumb -if re.search('mthumb', config.target_cflags) is None: +if not config.arm_thumb: config.available_features.add('fast-unwinder-works') # Turn on leak detection on 64-bit Linux. Index: compiler-rt/test/asan/lit.site.cfg.py.in =================================================================== --- compiler-rt/test/asan/lit.site.cfg.py.in +++ compiler-rt/test/asan/lit.site.cfg.py.in @@ -5,6 +5,7 @@ config.target_cflags = "@ASAN_TEST_TARGET_CFLAGS@" config.clang = "@ASAN_TEST_TARGET_CC@" config.bits = "@ASAN_TEST_BITS@" +config.arm_thumb = "@COMPILER_RT_ARM_THUMB@" config.apple_platform = "@ASAN_TEST_APPLE_PLATFORM@" config.apple_platform_min_deployment_target_flag = "@ASAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" config.asan_dynamic = @ASAN_TEST_DYNAMIC@