diff options
author | Will Schmidt <will_schmidt@vnet.ibm.com> | 2014-10-15 18:34:04 +0000 |
---|---|---|
committer | Will Schmidt <will_schmidt@vnet.ibm.com> | 2014-10-15 18:34:04 +0000 |
commit | c57a8a6547299f9b65dadcab02dde232b88fb31d (patch) | |
tree | ddd6e456b02329fa09a848507f68aaf4d247dda8 /lib/sanitizer_common/sanitizer_posix.cc | |
parent | 1d7819bcce8836dc543e200d6acc1fac8ded0a36 (diff) |
[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
Diffstat (limited to 'lib/sanitizer_common/sanitizer_posix.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_posix.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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 |