Skip to content

Commit f2747d1

Browse files
committed
build: Restrict check for CRC32C intrinsic to aarch64
`crc32c`'s hardware accelerated code doesn't handle ARM 32-bit at all. Make the check in `configure.ac` check for this architecture explicitly. For the release binaries, the current `configure.ac` check happens to work: it enables it on aarch64 but disables it for armhf. However some combination of compiler version and settings might ostensibly cause this check to succeed on armhf (as reported on IRC). So make the 64-bit platform requirement explicit.
1 parent 6ef84e0 commit f2747d1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,17 @@ AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc+crypto],[[ARM_CRC_CXXFLAGS="-march=arm
568568

569569
TEMP_CXXFLAGS="$CXXFLAGS"
570570
CXXFLAGS="$CXXFLAGS $ARM_CRC_CXXFLAGS"
571-
AC_MSG_CHECKING(for ARM CRC32 intrinsics)
571+
AC_MSG_CHECKING(for AArch64 CRC32 intrinsics)
572572
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
573573
#include <arm_acle.h>
574574
#include <arm_neon.h>
575575
]],[[
576+
#ifdef __aarch64__
576577
__crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0);
577578
vmull_p64(0, 0);
579+
#else
580+
#error "crc32c library does not support hardware acceleration on 32-bit ARM"
581+
#endif
578582
]])],
579583
[ AC_MSG_RESULT(yes); enable_arm_crc=yes; ],
580584
[ AC_MSG_RESULT(no)]

0 commit comments

Comments
 (0)