]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake/modules/SIMDExt.cmake: armv8 crypto intrinsics 14132/head
authorDan Mick <dan.mick@redhat.com>
Sat, 25 Mar 2017 03:12:38 +0000 (20:12 -0700)
committerDan Mick <dan.mick@redhat.com>
Mon, 27 Mar 2017 16:35:22 +0000 (09:35 -0700)
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 <dan.mick@redhat.com>
cmake/modules/SIMDExt.cmake

index badb94adb4bcbb8a7d6b24773bd1570ec4bb12be..bcc492f3af06a27c2f261c66491ace400daf9cba 100644 (file)
@@ -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 <inttypes.h>
+      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")