1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-26 11:46:04 +02:00

Fix build for big endian AArch64 hosts

The implementation does not support using arm neon on big-endian hosts: see
blake3_neon.c. Setting `BLAKE3_USE_NEON` to 1 by default for all AArch64
hosts broke builds for big endian hosts. This patch fixes the behavior
by introducing an additional check against `__ARM_BIG_ENDIAN` before
setting `BLAKE3_USE_NEON`.
This commit is contained in:
Daniil Kovalev 2023-08-31 02:12:38 +03:00
parent 12823b8760
commit 28424ec24d

View File

@ -49,8 +49,9 @@ enum blake3_flags {
#endif
#if !defined(BLAKE3_USE_NEON)
// If BLAKE3_USE_NEON not manually set, autodetect based on AArch64ness
#if defined(IS_AARCH64)
// If BLAKE3_USE_NEON not manually set, autodetect based on
// AArch64ness and endianness.
#if defined(IS_AARCH64) && !defined(__ARM_BIG_ENDIAN)
#define BLAKE3_USE_NEON 1
#else
#define BLAKE3_USE_NEON 0