diff --git a/crypto/fipsmodule/cpucap/cpu_arm_freebsd.c b/crypto/fipsmodule/cpucap/cpu_arm_freebsd.c index 209a49f084..ac71ac27b1 100644 --- a/crypto/fipsmodule/cpucap/cpu_arm_freebsd.c +++ b/crypto/fipsmodule/cpucap/cpu_arm_freebsd.c @@ -30,7 +30,9 @@ void OPENSSL_cpuid_setup(void) { // left at zero. The rest of this function will then gracefully report // the features are absent. elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)); +#if defined(AT_HWCAP2) elf_aux_info(AT_HWCAP2, &hwcap2, sizeof(hwcap2)); +#endif // Matching OpenSSL, only report other features if NEON is present. if (hwcap & HWCAP_NEON) { diff --git a/crypto/fipsmodule/cpucap/cpu_arm_linux.c b/crypto/fipsmodule/cpucap/cpu_arm_linux.c index e4ab5ab492..a2c5a18096 100644 --- a/crypto/fipsmodule/cpucap/cpu_arm_linux.c +++ b/crypto/fipsmodule/cpucap/cpu_arm_linux.c @@ -118,7 +118,11 @@ void OPENSSL_cpuid_setup(void) { // this is now rare (see Chrome's Net.NeedsHWCAP2Workaround metric), but AES // and PMULL extensions are very useful, so we still carry the workaround // for now. +#if defined(AT_HWCAP2) unsigned long hwcap2 = getauxval(AT_HWCAP2); +#else + unsigned long hwcap2 = 0; +#endif if (hwcap2 == 0) { hwcap2 = crypto_get_arm_hwcap2_from_cpuinfo(&cpuinfo); g_needs_hwcap2_workaround = hwcap2 != 0; diff --git a/crypto/fipsmodule/cpucap/cpu_ppc64le.c b/crypto/fipsmodule/cpucap/cpu_ppc64le.c index 61fe953846..db420dcc72 100644 --- a/crypto/fipsmodule/cpucap/cpu_ppc64le.c +++ b/crypto/fipsmodule/cpucap/cpu_ppc64le.c @@ -68,7 +68,11 @@ static void handle_cpu_env(unsigned long *out, const char *in) { extern uint8_t OPENSSL_cpucap_initialized; void OPENSSL_cpuid_setup(void) { +#if defined(AT_HWCAP2) OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2); +#else + OPENSSL_ppc64le_hwcap2 = 0; +#endif OPENSSL_cpucap_initialized = 1; // OPENSSL_ppccap is a 64-bit hex string which may start with "0x".