diff --git a/include/openssl/cpu.h b/include/openssl/cpu.h index dad544e7f6..3f5fe66d5d 100644 --- a/include/openssl/cpu.h +++ b/include/openssl/cpu.h @@ -98,6 +98,14 @@ extern uint32_t OPENSSL_ia32cap_P[4]; #if defined(OPENSSL_APPLE) /* iOS builds use the static ARM configuration. */ #define OPENSSL_STATIC_ARMCAP + +#if defined(OPENSSL_AARCH64) +#define OPENSSL_STATIC_ARMCAP_AES +#define OPENSSL_STATIC_ARMCAP_SHA1 +#define OPENSSL_STATIC_ARMCAP_SHA256 +#define OPENSSL_STATIC_ARMCAP_PMULL +#endif + #endif #if !defined(OPENSSL_STATIC_ARMCAP) diff --git a/src/init.rs b/src/init.rs index 7b5dcf7fdf..c8745c658a 100644 --- a/src/init.rs +++ b/src/init.rs @@ -14,12 +14,18 @@ #[allow(unsafe_code)] #[inline(always)] +#[cfg(not(all(target_arch = "aarch64", target_os = "ios")))] pub fn init_once() { extern crate std; static INIT: std::sync::Once = std::sync::ONCE_INIT; INIT.call_once(|| unsafe { OPENSSL_cpuid_setup() }); } +#[cfg(not(all(target_arch = "aarch64", target_os = "ios")))] extern { fn OPENSSL_cpuid_setup(); } + +#[cfg(all(target_arch = "aarch64", target_os = "ios"))] +pub fn init_once() { +}