From: miod Date: Sat, 3 May 2014 19:36:47 +0000 (+0000) Subject: Do not compile the neon probe code until __ARM_ARCH__ >= 7. Neon-specific code X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=452d3741c026e63df1d31ebc598446536f01ae4b;p=openbsd Do not compile the neon probe code until __ARM_ARCH__ >= 7. Neon-specific code will not get referenced if this condition is not met. --- diff --git a/lib/libcrypto/armcap.c b/lib/libcrypto/armcap.c index f40993c1d55..0476f5a4f5c 100644 --- a/lib/libcrypto/armcap.c +++ b/lib/libcrypto/armcap.c @@ -9,6 +9,7 @@ unsigned int OPENSSL_armcap_P; +#if __ARM_ARCH__ >= 7 static sigset_t all_masked; static sigjmp_buf ill_jmp; @@ -20,6 +21,7 @@ static sigjmp_buf ill_jmp; * ARM compilers support inline assembler... */ void _armv7_neon_probe(void); +#endif #if defined(__GNUC__) && __GNUC__>=2 void OPENSSL_cpuid_setup(void) __attribute__((constructor)); @@ -28,20 +30,29 @@ void OPENSSL_cpuid_setup(void) __attribute__((constructor)); void OPENSSL_cpuid_setup(void) { +#ifndef __OpenBSD__ char *e; +#endif +#if __ARM_ARCH__ >= 7 struct sigaction ill_oact, ill_act; sigset_t oset; +#endif static int trigger = 0; if (trigger) return; trigger = 1; +#ifndef __OpenBSD__ if ((e = getenv("OPENSSL_armcap"))) { OPENSSL_armcap_P = strtoul(e, NULL, 0); return; } +#endif + OPENSSL_armcap_P = 0; + +#if __ARM_ARCH__ >= 7 sigfillset(&all_masked); sigdelset(&all_masked, SIGILL); sigdelset(&all_masked, SIGTRAP); @@ -49,8 +60,6 @@ OPENSSL_cpuid_setup(void) sigdelset(&all_masked, SIGBUS); sigdelset(&all_masked, SIGSEGV); - OPENSSL_armcap_P = 0; - memset(&ill_act, 0, sizeof(ill_act)); ill_act.sa_handler = ill_handler; ill_act.sa_mask = all_masked; @@ -65,4 +74,5 @@ OPENSSL_cpuid_setup(void) sigaction (SIGILL, &ill_oact, NULL); sigprocmask(SIG_SETMASK, &oset, NULL); +#endif } diff --git a/lib/libcrypto/armv4cpuid.S b/lib/libcrypto/armv4cpuid.S index 2354b39a552..5ca979f3b3e 100644 --- a/lib/libcrypto/armv4cpuid.S +++ b/lib/libcrypto/armv4cpuid.S @@ -4,12 +4,14 @@ .code 32 .align 5 +#if __ARM_ARCH__>=7 .global _armv7_neon_probe .type _armv7_neon_probe,%function _armv7_neon_probe: .word 0xf26ee1fe @ vorr q15,q15,q15 .word 0xe12fff1e @ bx lr .size _armv7_neon_probe,.-_armv7_neon_probe +#endif .global OPENSSL_atomic_add .type OPENSSL_atomic_add,%function diff --git a/lib/libssl/src/crypto/armcap.c b/lib/libssl/src/crypto/armcap.c index f40993c1d55..0476f5a4f5c 100644 --- a/lib/libssl/src/crypto/armcap.c +++ b/lib/libssl/src/crypto/armcap.c @@ -9,6 +9,7 @@ unsigned int OPENSSL_armcap_P; +#if __ARM_ARCH__ >= 7 static sigset_t all_masked; static sigjmp_buf ill_jmp; @@ -20,6 +21,7 @@ static sigjmp_buf ill_jmp; * ARM compilers support inline assembler... */ void _armv7_neon_probe(void); +#endif #if defined(__GNUC__) && __GNUC__>=2 void OPENSSL_cpuid_setup(void) __attribute__((constructor)); @@ -28,20 +30,29 @@ void OPENSSL_cpuid_setup(void) __attribute__((constructor)); void OPENSSL_cpuid_setup(void) { +#ifndef __OpenBSD__ char *e; +#endif +#if __ARM_ARCH__ >= 7 struct sigaction ill_oact, ill_act; sigset_t oset; +#endif static int trigger = 0; if (trigger) return; trigger = 1; +#ifndef __OpenBSD__ if ((e = getenv("OPENSSL_armcap"))) { OPENSSL_armcap_P = strtoul(e, NULL, 0); return; } +#endif + OPENSSL_armcap_P = 0; + +#if __ARM_ARCH__ >= 7 sigfillset(&all_masked); sigdelset(&all_masked, SIGILL); sigdelset(&all_masked, SIGTRAP); @@ -49,8 +60,6 @@ OPENSSL_cpuid_setup(void) sigdelset(&all_masked, SIGBUS); sigdelset(&all_masked, SIGSEGV); - OPENSSL_armcap_P = 0; - memset(&ill_act, 0, sizeof(ill_act)); ill_act.sa_handler = ill_handler; ill_act.sa_mask = all_masked; @@ -65,4 +74,5 @@ OPENSSL_cpuid_setup(void) sigaction (SIGILL, &ill_oact, NULL); sigprocmask(SIG_SETMASK, &oset, NULL); +#endif } diff --git a/lib/libssl/src/crypto/armv4cpuid.S b/lib/libssl/src/crypto/armv4cpuid.S index 2354b39a552..5ca979f3b3e 100644 --- a/lib/libssl/src/crypto/armv4cpuid.S +++ b/lib/libssl/src/crypto/armv4cpuid.S @@ -4,12 +4,14 @@ .code 32 .align 5 +#if __ARM_ARCH__>=7 .global _armv7_neon_probe .type _armv7_neon_probe,%function _armv7_neon_probe: .word 0xf26ee1fe @ vorr q15,q15,q15 .word 0xe12fff1e @ bx lr .size _armv7_neon_probe,.-_armv7_neon_probe +#endif .global OPENSSL_atomic_add .type OPENSSL_atomic_add,%function