Skip to content

Commit c11f348

Browse files
committed
Fix: Address feedback on HACL* universal2 configure checks
1 parent 494672b commit c11f348

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

configure

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7920,6 +7920,13 @@ AC_SUBST([LIBHACL_CFLAGS])
79207920
LIBHACL_LDFLAGS= # for now, no specific linker flags are needed
79217921
AC_SUBST([LIBHACL_LDFLAGS])
79227922

7923+
# Determine if the specific HACL* universal2 implementation should be used
7924+
use_hacl_universal2_impl=no
7925+
if test "$UNIVERSAL_ARCHS" = "universal2" -o \
7926+
\( "$build_cpu" = "aarch64" -a "$build_vendor" = "apple" \); then
7927+
use_hacl_universal2_impl=yes
7928+
fi
7929+
79237930
# The SIMD files use aligned_alloc, which is not available on older versions of
79247931
# Android.
79257932
# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
@@ -7936,7 +7943,7 @@ then
79367943
# available on x86_64. However, performance of the HACL SIMD128 implementation
79377944
# isn't great, so it's disabled on ARM64.
79387945
AC_MSG_CHECKING([for HACL* SIMD128 implementation])
7939-
if test "$UNIVERSAL_ARCHS" = "universal2" -o \( "$build_cpu" = "aarch64" -a "$build_vendor" = "apple" \); then
7946+
if test "$use_hacl_universal2_impl" = "yes"; then
79407947
[LIBHACL_BLAKE2_SIMD128_OBJS="Modules/_hacl/Hacl_Hash_Blake2s_Simd128_universal2.o"]
79417948
AC_MSG_RESULT([universal2])
79427949
else
@@ -7968,7 +7975,7 @@ then
79687975
# implementation requires symbols that aren't available on ARM64. Use a
79697976
# wrapped implementation if we're building for universal2.
79707977
AC_MSG_CHECKING([for HACL* SIMD256 implementation])
7971-
if test "$UNIVERSAL_ARCHS" = "universal2" -o \( "$build_cpu" = "aarch64" -a "$build_vendor" = "apple" \); then
7978+
if test "$use_hacl_universal2_impl" = "yes"; then
79727979
[LIBHACL_BLAKE2_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256_universal2.o"]
79737980
AC_MSG_RESULT([universal2])
79747981
else

0 commit comments

Comments
 (0)