From 1fd8a45ca67657cbf178d69c772fa88b9b257da3 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 5 Jun 2023 18:44:31 +0100 Subject: [PATCH] cmake: Restrict check for CRC32C intrinsic to aarch64 The HAVE_ARM64_CRC32C test can erroneously pass when building on armv7, resulting in a broken library and failed tests. This change addresses the issue by narrowing the check to aarch64 platforms. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0b8e7c..da0b4a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,8 +149,12 @@ check_cxx_source_compiles(" #include int main() { +#ifdef __aarch64__ __crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0); vmull_p64(0, 0); +#else +#error CRC32C library does not support hardware acceleration on ARM 32-bit +#endif return 0; } " HAVE_ARM64_CRC32C)