From c2897a158a02a05a4d7d1115e1d81f34166ef729 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Tue, 18 Dec 2018 08:41:34 -0800 Subject: [PATCH] Don't enable intrinsics on x86 without ABI support. At some point after GCC 7.3, but before 8.2, GCC enabled the SSE ABI by default. However, if it isn't enabled, the vector intrinsics in HRSS cannot be used. (See https://github.com/grpc/grpc/issues/17540.) Note that the intrinsics used are SSE2, but that should be ok because they are guarded by a run-time check. The compile-time check for __SSE__ just ensures that GCC will build the code at all. (SDE does not simulate anything that doesn't have SSE2, however.) Change-Id: If092a06a441ed9d38576ea30351b3b40693a3399 Reviewed-on: https://boringssl-review.googlesource.com/c/33744 Reviewed-by: David Benjamin Commit-Queue: David Benjamin --- crypto/hrss/hrss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/hrss/hrss.c b/crypto/hrss/hrss.c index d9ed0d94..ff68e9b2 100644 --- a/crypto/hrss/hrss.c +++ b/crypto/hrss/hrss.c @@ -62,7 +62,7 @@ // NEON and SSE2 for implementing some vector operations. // TODO: MSVC can likely also be made to work with vector operations. -#if (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) && \ +#if ((defined(__SSE__) && defined(OPENSSL_X86)) || defined(OPENSSL_X86_64)) && \ (defined(__clang__) || !defined(_MSC_VER)) #define HRSS_HAVE_VECTOR_UNIT