[compiler-rt] r318775 - [sanitizer] Define SANITIZER_USE_GETAUXVAL for Android
Kostya Kortchinsky via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 08:08:07 PST 2017
Author: cryptoad
Date: Tue Nov 21 08:08:07 2017
New Revision: 318775
URL: http://llvm.org/viewvc/llvm-project?rev=318775&view=rev
Log:
[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
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h?rev=318775&r1=318774&r2=318775&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h Tue Nov 21 08:08:07 2017
@@ -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
More information about the llvm-commits
mailing list