diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-01-25 19:25:20 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-01-25 19:25:20 +0000 |
commit | 2531584daa4770d3b0ac822ea175ce0e05c6819b (patch) | |
tree | 585a71a5ff76f26cdeb2c1181f3e4c436636095a | |
parent | cfe5e2c8467b778ac1e77b0adcf9f74bbc9aa663 (diff) | |
download | bcm5719-llvm-2531584daa4770d3b0ac822ea175ce0e05c6819b.tar.gz bcm5719-llvm-2531584daa4770d3b0ac822ea175ce0e05c6819b.zip |
[asan] Don't use sysconf(_SC_PAGESIZE) on Android.
This is broken in the current (post-MNC) master branch.
Use EXEC_PAGESIZE instead, the same as on x86 Linux.
This change fixes startup crashes in the existing tests on AOSP
master.
llvm-svn: 258706
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_linux.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index 69d8d712654..3255ff0bea3 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc @@ -710,7 +710,9 @@ bool ThreadLister::GetDirectoryEntries() { } uptr GetPageSize() { -#if SANITIZER_LINUX && (defined(__x86_64__) || defined(__i386__)) +// Android post-M sysconf(_SC_PAGESIZE) crashes if called from .preinit_array. +#if (SANITIZER_LINUX && (defined(__x86_64__) || defined(__i386__))) || \ + SANITIZER_ANDROID return EXEC_PAGESIZE; #else return sysconf(_SC_PAGESIZE); // EXEC_PAGESIZE may not be trustworthy. |