From 7e875de7c257cbc633295c8fb6e59462e25e57fe Mon Sep 17 00:00:00 2001 From: Foolbar Date: Mon, 10 Jun 2024 00:44:18 +0800 Subject: [PATCH] arm64: CPU feature detection for Android getauxval() is available on Android since API 18. https://developer.android.com/ndk/guides/cpu-features#features_using_libcs_getauxval3 --- fat-arm64.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fat-arm64.c b/fat-arm64.c index 240302a6..45cce0cc 100644 --- a/fat-arm64.c +++ b/fat-arm64.c @@ -43,9 +43,14 @@ #if defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) # if __GLIBC_PREREQ(2, 16) # define USE_GETAUXVAL 1 -# include -# include # endif +#elif __ANDROID_API__ >= 18 +# define USE_GETAUXVAL 1 +#endif + +#if USE_GETAUXVAL +# include +# include #elif defined(__OpenBSD__) # include # include -- 2.47.3