From: Lars Immisch Date: Thu, 5 Mar 2020 10:26:06 +0000 (+0100) Subject: Use getauxval on Android with API level > 18 X-Git-Tag: OpenSSL_1_1_1l~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2357e6e94a46362dbf56eecfec6ffbaa8bd76a68;p=thirdparty%2Fopenssl.git Use getauxval on Android with API level > 18 We received analytics that devices of the device family Oppo A37x are crashing with SIGILL when trying to load libcrypto.so. These crashes were fixed by using the system-supplied getauxval function. Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15763) --- diff --git a/crypto/armcap.c b/crypto/armcap.c index 9e209f36aa7..c5685bde589 100644 --- a/crypto/armcap.c +++ b/crypto/armcap.c @@ -93,6 +93,15 @@ static unsigned long getauxval(unsigned long key) # endif # endif +/* + * Android: according to https://developer.android.com/ndk/guides/cpu-features, + * getauxval is supported starting with API level 18 + */ +# if defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__ >= 18 +# include +# define OSSL_IMPLEMENT_GETAUXVAL +# endif + /* * ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas * AArch64 used AT_HWCAP.