summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_posix.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
index 06b05e8920b..2cd2a7c4ddb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
@@ -24,6 +24,9 @@
#if SANITIZER_LINUX
#include <sys/utsname.h>
+#endif
+
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
#include <sys/personality.h>
#endif
@@ -52,6 +55,7 @@ static uptr GetKernelAreaSize() {
return 0;
}
+#if !SANITIZER_ANDROID
// Even if nothing is mapped, top Gb may still be accessible
// if we are running on 64-bit kernel.
// Uname may report misleading results if personality type
@@ -62,6 +66,7 @@ static uptr GetKernelAreaSize() {
&& uname(&uname_info) == 0
&& internal_strstr(uname_info.machine, "64"))
return 0;
+#endif // SANITIZER_ANDROID
// Top gigabyte is reserved for kernel.
return gbyte;
OpenPOWER on IntegriCloud