From 7aec786bbb34db5cd7e539d40a97cab5e7562f6f Mon Sep 17 00:00:00 2001 From: Pietro Monteiro Date: Mon, 23 May 2016 17:51:17 -0700 Subject: [PATCH] Add static list of CPU capabilities for aarch64 ios. I agree to license my contributions to each file under the terms given at the top of each file I changed. --- include/openssl/cpu.h | 8 ++++++++ src/init.rs | 6 ++++++ 2 files changed, 14 insertions(+) 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() { +}