From 2e96469465f8f8282163f9ac77c660ec8696cd78 Mon Sep 17 00:00:00 2001 From: Kostya Kortchinsky Date: Tue, 21 Nov 2017 16:08:07 +0000 Subject: [PATCH] [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 llvm-svn: 318775 --- compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h b/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h index d0287f0..7b255c6 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h +++ b/compiler-rt/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 -- 2.7.4