From ac4815f74b9fad5285b264a8d62d60c75569fc35 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 24 Mar 2017 20:12:38 -0700 Subject: [PATCH] cmake/modules/SIMDExt.cmake: armv8 crypto intrinsics Test not only for -march support, but also the actual presence of the intrinsic routines. Not sure why, but gcc 4.8.5 passes the first but not the second. Fixes: http://tracker.ceph.com/issues/19386 Signed-off-by: Dan Mick --- cmake/modules/SIMDExt.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/modules/SIMDExt.cmake b/cmake/modules/SIMDExt.cmake index badb94adb4b..bcc492f3af0 100644 --- a/cmake/modules/SIMDExt.cmake +++ b/cmake/modules/SIMDExt.cmake @@ -44,7 +44,18 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64") if(HAVE_ARMV8_CRYPTO) message(STATUS " aarch64 crypto extensions supported") endif() - CHECK_C_COMPILER_FLAG(-march=armv8-a+crc+crypto HAVE_ARMV8_CRC_CRYPTO_INTRINSICS) + CHECK_C_COMPILER_FLAG(-march=armv8-a+crc+crypto HAVE_ARMV8_CRC_CRYPTO_MARCH) + + # don't believe only the -march support; gcc 4.8.5 on RHEL/CentOS says + # it supports +crc but hasn't got the intrinsics or arm_acle.h. Test for + # the actual presence of one of the intrinsic functions. + if(HAVE_ARMV8_CRC_CRYPTO_MARCH) + check_cxx_source_compiles(" + #include + int main() { uint32_t a; uint8_t b; __builtin_aarch64_crc32b(a, b); } + " HAVE_ARMV8_CRC_CRYPTO_INTRINSICS) + endif() + if(HAVE_ARMV8_CRC_CRYPTO_INTRINSICS) message(STATUS " aarch64 crc+crypto intrinsics supported") set(ARMV8_CRC_COMPILE_FLAGS "${ARMV8_CRC_COMPILE_FLAGS} -march=armv8-a+crc+crypto") -- 2.39.5