From d77394c5f2ec4d4f5241ca293d7bf66299bc91cd Mon Sep 17 00:00:00 2001 From: Alex Shlyapnikov Date: Thu, 13 Apr 2017 16:17:32 +0000 Subject: [PATCH] Enable LSan on PowerPC64. Summary: With D31555 commited, looks like basic LSan functionality works on PPC64. Time to enable LSan there. Reviewers: eugenis Subscribers: nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D31995 llvm-svn: 300204 --- compiler-rt/lib/lsan/lsan_allocator.h | 2 +- compiler-rt/lib/lsan/lsan_common.h | 3 ++- compiler-rt/test/lsan/lit.common.cfg | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h index e5def17..fad5adb 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.h +++ b/compiler-rt/lib/lsan/lsan_allocator.h @@ -59,7 +59,7 @@ typedef CompactSizeClassMap SizeClassMap; typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(ChunkMetadata), SizeClassMap, kRegionSizeLog, ByteMap> PrimaryAllocator; -#elif defined(__x86_64__) +#elif defined(__x86_64__) || defined(__powerpc64__) struct AP64 { // Allocator64 parameters. Deliberately using a short name. static const uptr kSpaceBeg = 0x600000000000ULL; static const uptr kSpaceSize = 0x40000000000ULL; // 4T. diff --git a/compiler-rt/lib/lsan/lsan_common.h b/compiler-rt/lib/lsan/lsan_common.h index 2851a66..fb96270 100644 --- a/compiler-rt/lib/lsan/lsan_common.h +++ b/compiler-rt/lib/lsan/lsan_common.h @@ -32,7 +32,8 @@ // new architecture inside sanitizer library. #if (SANITIZER_LINUX && !SANITIZER_ANDROID || SANITIZER_MAC) && \ (SANITIZER_WORDSIZE == 64) && \ - (defined(__x86_64__) || defined(__mips64) || defined(__aarch64__)) + (defined(__x86_64__) || defined(__mips64) || defined(__aarch64__) || \ + defined(__powerpc64__)) #define CAN_SANITIZE_LEAKS 1 #elif defined(__i386__) && \ (SANITIZER_LINUX && !SANITIZER_ANDROID || SANITIZER_MAC) diff --git a/compiler-rt/test/lsan/lit.common.cfg b/compiler-rt/test/lsan/lit.common.cfg index b90c7ef..c0107e7 100644 --- a/compiler-rt/test/lsan/lit.common.cfg +++ b/compiler-rt/test/lsan/lit.common.cfg @@ -52,8 +52,9 @@ config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) ) config.substitutions.append( ("%clang_lsan ", build_invocation(clang_lsan_cflags)) ) config.substitutions.append( ("%clangxx_lsan ", build_invocation(clang_lsan_cxxflags)) ) -# LeakSanitizer tests are currently supported on x86-64 Linux, arm Linux and mips64 Linux only. -if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64', 'mips64', 'arm', 'armhf', 'armv7l']: +# LeakSanitizer tests are currently supported on x86-64 Linux, PowerPC64 Linux, arm Linux and mips64 Linux only. +# LSAN breaks on Thumb, so disabling from all ARM targets until we sort this out. PR32636. +if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64', 'mips64', 'arm', 'armhf', 'armv7l', 'ppc64']: config.unsupported = True # Don't support Thumb due to broken fast unwinder -- 2.7.4