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>
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;