[compiler-rt] a53ea51 - [lsan] ppc64: dynamically pick address range for allocator
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 11 20:16:23 PST 2022
Author: Fangrui Song
Date: 2022-03-11T20:16:17-08:00
New Revision: a53ea51dec34e0825bc44d7789e904964c4105ff
URL: https://github.com/llvm/llvm-project/commit/a53ea51dec34e0825bc44d7789e904964c4105ff
DIFF: https://github.com/llvm/llvm-project/commit/a53ea51dec34e0825bc44d7789e904964c4105ff.diff
LOG: [lsan] ppc64: dynamically pick address range for allocator
For ppc64 PIE, it seems that [0xa00000000000,0xc00000000000) may be occupied
which will lead to a segfault in certain kernel configurations
(clang-ppc64le-rhel). Use the `!kUsingConstantSpaceBeg` code path like Fuchsia.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D121257
Added:
Modified:
compiler-rt/lib/lsan/lsan_allocator.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h
index 45c6ac406f8a1..539330491b02a 100644
--- a/compiler-rt/lib/lsan/lsan_allocator.h
+++ b/compiler-rt/lib/lsan/lsan_allocator.h
@@ -66,12 +66,9 @@ template <typename AddressSpaceView>
using PrimaryAllocatorASVT = SizeClassAllocator32<AP32<AddressSpaceView>>;
using PrimaryAllocator = PrimaryAllocatorASVT<LocalAddressSpaceView>;
#elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__)
-# if SANITIZER_FUCHSIA
+# if SANITIZER_FUCHSIA || defined(__powerpc64__)
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
-# elif defined(__powerpc64__)
-const uptr kAllocatorSpace = 0xa0000000000ULL;
-const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
#elif defined(__s390x__)
const uptr kAllocatorSpace = 0x40000000000ULL;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
More information about the llvm-commits
mailing list