Skip to content

Commit

Permalink
Add static list of CPU capabilities for aarch64 ios.
Browse files Browse the repository at this point in the history
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
  • Loading branch information
pietro committed May 24, 2016
1 parent db3e647 commit 7aec786
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/openssl/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}

0 comments on commit 7aec786

Please sign in to comment.