]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
arch/arm: Allow ceph_crc32c_aarch64 to be chosen only if it is compiled in 24126/head
authorplanetbeing <planetbeing@gmail.com>
Mon, 17 Sep 2018 08:00:07 +0000 (01:00 -0700)
committerDavid Wang <planetbeing@gmail.com>
Mon, 17 Sep 2018 08:07:56 +0000 (01:07 -0700)
If the build host does not support the crc32cx instruction, HAVE_ARMV8_CRC will not be set and ceph_crc32c_aarch64 will be a dummy function that always returns zero. However, if HWCAP_CRC32 is supported on the actual target machine, that dummy function will be selected anyway. This patch ensures ceph_crc32c_aarch64 will never be chosen if it is not compiled in.

Fixes: https://tracker.ceph.com/issues/36030
Signed-off-by: David Wang <planetbeing@gmail.com>
src/common/crc32c.cc

index d5c984ab463e24fafe468e0b861710a411d28156..e4a77ae99aebf518934bee2269d1bae5a57eaa92 100644 (file)
@@ -27,9 +27,11 @@ ceph_crc32c_func_t ceph_choose_crc32(void)
     return ceph_crc32c_intel_fast;
   }
 #elif defined(__arm__) || defined(__aarch64__)
+# if defined(HAVE_ARMV8_CRC)
   if (ceph_arch_aarch64_crc32){
     return ceph_crc32c_aarch64;
   }
+# endif
 #elif defined(__powerpc__) || defined(__ppc__)
   if (ceph_arch_ppc_crc32) {
     return ceph_crc32c_ppc;