enable getauxval on android 10
authoryunh <haihai107@126.com>
Wed, 23 Jun 2021 01:46:42 +0000 (09:46 +0800)
committerPauli <pauli@openssl.org>
Fri, 25 Jun 2021 08:31:05 +0000 (18:31 +1000)
Fixes #9498

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15870)

(cherry picked from commit b2dea4d5f22ec146373324c282fb1bcecd5a7d90)

crypto/armcap.c
crypto/ppccap.c
crypto/uid.c

index 93aeac85a37ea6c0efd531e9adc34879d00c14be..62e166a4dd039fa157adafb0c58a888dc1be8ee8 100644 (file)
@@ -74,6 +74,12 @@ void OPENSSL_cpuid_setup(void) __attribute__ ((constructor));
 #   include <sys/auxv.h>
 #   define OSSL_IMPLEMENT_GETAUXVAL
 #  endif
+# elif defined(__ANDROID_API__)
+/* see https://developer.android.google.cn/ndk/guides/cpu-features */
+#  if __ANDROID_API__ >= 18
+#   include <sys/auxv.h>
+#   define OSSL_IMPLEMENT_GETAUXVAL
+#  endif
 # endif
 # if defined(__FreeBSD__)
 #  include <sys/param.h>
index c9f82c6b5eecda4c695b81a92f6b2c56637d49b7..8bcfed25e057624981a6daa325e50af3a10ef19d 100644 (file)
@@ -89,6 +89,12 @@ size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max)
 # if __GLIBC_PREREQ(2, 16)
 #  include <sys/auxv.h>
 #  define OSSL_IMPLEMENT_GETAUXVAL
+# elif defined(__ANDROID_API__)
+/* see https://developer.android.google.cn/ndk/guides/cpu-features */
+#  if __ANDROID_API__ >= 18
+#   include <sys/auxv.h>
+#   define OSSL_IMPLEMENT_GETAUXVAL
+#  endif
 # endif
 #endif
 
index 55e276dfe4596341ccabfca9b7ba2c50449b381b..60af78b9e06873ddf32399ffc5f0c396ca625e57 100644 (file)
@@ -36,6 +36,12 @@ int OPENSSL_issetugid(void)
 #   include <sys/auxv.h>
 #   define OSSL_IMPLEMENT_GETAUXVAL
 #  endif
+# elif defined(__ANDROID_API__)
+/* see https://developer.android.google.cn/ndk/guides/cpu-features */
+#  if __ANDROID_API__ >= 18
+#   include <sys/auxv.h>
+#   define OSSL_IMPLEMENT_GETAUXVAL
+#  endif
 # endif
 
 int OPENSSL_issetugid(void)