Skip to content

Commit efb9f00

Browse files
laanwjfanquake
authored andcommitted
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. Github-Pull: #23045 Rebased-From: f2747d1
1 parent cfb08c3 commit efb9f00

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
@@ -535,13 +535,17 @@ AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc+crypto],[[ARM_CRC_CXXFLAGS="-march=arm
535535

536536
TEMP_CXXFLAGS="$CXXFLAGS"
537537
CXXFLAGS="$CXXFLAGS $ARM_CRC_CXXFLAGS"
538-
AC_MSG_CHECKING(for ARM CRC32 intrinsics)
538+
AC_MSG_CHECKING(for AArch64 CRC32 intrinsics)
539539
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
540540
#include <arm_acle.h>
541541
#include <arm_neon.h>
542542
]],[[
543+
#ifdef __aarch64__
543544
__crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0);
544545
vmull_p64(0, 0);
546+
#else
547+
#error "crc32c library does not support hardware acceleration on 32-bit ARM"
548+
#endif
545549
]])],
546550
[ AC_MSG_RESULT(yes); enable_arm_crc=yes; ],
547551
[ AC_MSG_RESULT(no)]

0 commit comments

Comments
 (0)