From: Dan Mick Date: Sat, 25 Mar 2017 03:12:38 +0000 (-0700) Subject: cmake/modules/SIMDExt.cmake: armv8 crypto intrinsics X-Git-Tag: v12.0.2~297^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14132%2Fhead;p=ceph.git 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 --- diff --git a/cmake/modules/SIMDExt.cmake b/cmake/modules/SIMDExt.cmake index badb94adb4bc..bcc492f3af06 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")