summaryrefslogtreecommitdiffstats
path: root/crypto/armcap.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2017-02-15 12:01:09 +0100
committerAndy Polyakov <appro@openssl.org>2017-02-15 23:16:23 +0100
commit8653e78f4319b23d60239f9557d8c1e1d23be1a5 (patch)
tree91aafee458dd6bfe0cd065bf6aa495dc8607f2c4 /crypto/armcap.c
parentc93f06c12f10c07cea935abd78a07a037e27f155 (diff)
crypto/armcap.c: short-circuit processor capability probe in iOS builds.
Capability probing by catching SIGILL appears to be problematic on iOS. But since Apple universe is "monocultural", it's actually possible to simply set pre-defined processor capability mask. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2617)
Diffstat (limited to 'crypto/armcap.c')
-rw-r--r--crypto/armcap.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/armcap.c b/crypto/armcap.c
index 4215766bf4..29534845d1 100644
--- a/crypto/armcap.c
+++ b/crypto/armcap.c
@@ -111,6 +111,24 @@ void OPENSSL_cpuid_setup(void)
return;
}
+# if defined(__APPLE__) && !defined(__aarch64__)
+ /*
+ * Capability probing by catching SIGILL appears to be problematic
+ * on iOS. But since Apple universe is "monocultural", it's actually
+ * possible to simply set pre-defined processor capability mask.
+ */
+ if (1) {
+ OPENSSL_armcap_P = ARMV7_NEON;
+ return;
+ }
+ /*
+ * One could do same even for __aarch64__ iOS builds. It's not done
+ * exclusively for reasons of keeping code unified across platforms.
+ * Unified code works because it never triggers SIGILL on Apple
+ * devices...
+ */
+# endif
+
sigfillset(&all_masked);
sigdelset(&all_masked, SIGILL);
sigdelset(&all_masked, SIGTRAP);