Skip to content

Conversation

@Dreaming-Codes
Copy link
Contributor

Building on aarch64-unknown-linux-gnu fails with:

error: pragma or attribute 'target("crc32")' is not valid
error: '_mm_crc32_u8' was not declared in this scope

The #if (CLANG || GCC) guard should also check for x86 since target("crc32") and _mm_crc32_u8 are x86-only.

Fixed by changing to #if (x86 && (CLANG || GCC)) and adding a software fallback in crc32_hw for non-x86.

The __attribute__((__target__("crc32"))) and _mm_crc32_u8 intrinsics
are x86-specific but were only guarded by #if (CLANG || GCC), causing
ARM64 builds to fail.

Changes:
- Add x86 guard to target("crc32") attribute
- Add #if (x86) guard around _mm_crc32_u8 with software fallback
@kernelwernel kernelwernel merged commit 8cf1cb0 into kernelwernel:main Jan 6, 2026
5 checks passed
@kernelwernel
Copy link
Owner

Thanks for catching the bug, this is incredibly helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants