From c57a8a6547299f9b65dadcab02dde232b88fb31d Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Wed, 15 Oct 2014 18:34:04 +0000 Subject: [compiler-rt] Enable ASAN for powerpc64le-linux Whitespace update for lint check by myself (Will). Otherwise code and comments by Peter Bergner, as previously seen on llvm-commits. The following patch gets ASAN somewhat working on powerpc64le-linux. It currently assumes the LE kernel uses 46-bit addressing, which is true, but it doesn't solve the case for BE where it may be 44 or 46 bits. That can be fixed with a follow on patch. There are some test suite fails even with this patch that I haven't had time to solve yet, but this is better than the state it is in now. The limited debugging of those test suite fails seems to show that the address map for 46-bit addressing has changed and so we'll need to modify the shadow memory location slightly. Again, that can be fixed with a follow on patch. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219827 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/sanitizer_posix.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/sanitizer_common/sanitizer_posix.cc') diff --git a/lib/sanitizer_common/sanitizer_posix.cc b/lib/sanitizer_common/sanitizer_posix.cc index 8df1fa72a..c93fbf565 100644 --- a/lib/sanitizer_common/sanitizer_posix.cc +++ b/lib/sanitizer_common/sanitizer_posix.cc @@ -78,13 +78,15 @@ static uptr GetKernelAreaSize() { uptr GetMaxVirtualAddress() { #if SANITIZER_WORDSIZE == 64 -# if defined(__powerpc64__) +# if defined(__powerpc64__) && defined(__BIG_ENDIAN__) // On PowerPC64 we have two different address space layouts: 44- and 46-bit. // We somehow need to figure out which one we are using now and choose // one of 0x00000fffffffffffUL and 0x00003fffffffffffUL. // Note that with 'ulimit -s unlimited' the stack is moved away from the top // of the address space, so simply checking the stack address is not enough. return (1ULL << 44) - 1; // 0x00000fffffffffffUL +# elif defined(__powerpc64__) && defined(__LITTLE_ENDIAN__) + return (1ULL << 46) - 1; // 0x00003fffffffffffUL # elif defined(__aarch64__) return (1ULL << 39) - 1; # else -- cgit v1.2.3