summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2017-11-21 16:08:07 +0000
committerKostya Kortchinsky <kostyak@google.com>2017-11-21 16:08:07 +0000
commitf5c4e6980b9a03990cbe80ce7eb85029fd9b37de (patch)
tree5a6ecd56eb28ba46b98fceb187258ef35ae11dc1 /lib
parent258a754d1c235494df54f953d9141d9d781b361a (diff)
[sanitizer] Define SANITIZER_USE_GETAUXVAL for Android
Summary: Android for API level >= 21 has `getauxval`. Enable `SANITIZER_USE_GETAUXVAL` when those requirements are met. Correct a typo in the header. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40260 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318775 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/sanitizer_common/sanitizer_getauxval.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_getauxval.h b/lib/sanitizer_common/sanitizer_getauxval.h
index d0287f02c..7b255c60b 100644
--- a/lib/sanitizer_common/sanitizer_getauxval.h
+++ b/lib/sanitizer_common/sanitizer_getauxval.h
@@ -8,7 +8,8 @@
//===----------------------------------------------------------------------===//
//
// Common getauxval() guards and definitions.
-// getauxval() is not defined until glbc version 2.16.
+// getauxval() is not defined until glibc version 2.16, or until API level 21
+// for Android.
//
//===----------------------------------------------------------------------===//
@@ -25,7 +26,7 @@
#define __GLIBC_PREREQ(x, y) 0
#endif
-#if __GLIBC_PREREQ(2, 16)
+#if __GLIBC_PREREQ(2, 16) || (SANITIZER_ANDROID && __ANDROID_API__ >= 21)
# define SANITIZER_USE_GETAUXVAL 1
#else
# define SANITIZER_USE_GETAUXVAL 0