[PATCH] D32314: Enable LSan on PowerPC64.

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 15:00:24 PDT 2017


alekseyshl created this revision.
Herald added a subscriber: nemanjai.

Re-landing reverted https://reviews.llvm.org/D31995 with suppressions defined in https://reviews.llvm.org/D32303.


https://reviews.llvm.org/D32314

Files:
  lib/lsan/lsan_allocator.h
  lib/lsan/lsan_common.h
  test/lsan/lit.common.cfg


Index: test/lsan/lit.common.cfg
===================================================================
--- test/lsan/lit.common.cfg
+++ test/lsan/lit.common.cfg
@@ -67,8 +67,8 @@
 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, mips64 Linux, and x86_64 Darwin
-supported_linux = config.host_os in ['Linux'] and config.host_arch in ['x86_64', 'mips64', 'arm', 'armhf', 'armv7l']
+# LeakSanitizer tests are currently supported on x86-64 Linux, PowerPC64 Linux, arm Linux, mips64 Linux, and x86_64 Darwin
+supported_linux = config.host_os in ['Linux'] and config.host_arch in ['x86_64', 'ppc64', 'mips64', 'arm', 'armhf', 'armv7l']
 supported_darwin = config.host_os is 'Darwin' and config.target_arch is 'x86_64'
 if not (supported_linux or supported_darwin):
   config.unsupported = True
Index: lib/lsan/lsan_common.h
===================================================================
--- lib/lsan/lsan_common.h
+++ 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)
Index: lib/lsan/lsan_allocator.h
===================================================================
--- lib/lsan/lsan_allocator.h
+++ lib/lsan/lsan_allocator.h
@@ -59,7 +59,7 @@
 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32314.96030.patch
Type: text/x-patch
Size: 2236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170420/b2532f0b/attachment.bin>


More information about the llvm-commits mailing list