@@ -7920,6 +7920,13 @@ AC_SUBST([LIBHACL_CFLAGS])
7920
7920
LIBHACL_LDFLAGS= # for now, no specific linker flags are needed
7921
7921
AC_SUBST ( [ LIBHACL_LDFLAGS] )
7922
7922
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
+
7923
7930
# The SIMD files use aligned_alloc, which is not available on older versions of
7924
7931
# Android.
7925
7932
# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
@@ -7936,7 +7943,7 @@ then
7936
7943
# available on x86_64. However, performance of the HACL SIMD128 implementation
7937
7944
# isn't great, so it's disabled on ARM64.
7938
7945
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
7940
7947
[ LIBHACL_BLAKE2_SIMD128_OBJS="Modules/_hacl/Hacl_Hash_Blake2s_Simd128_universal2.o"]
7941
7948
AC_MSG_RESULT ( [ universal2] )
7942
7949
else
@@ -7968,7 +7975,7 @@ then
7968
7975
# implementation requires symbols that aren't available on ARM64. Use a
7969
7976
# wrapped implementation if we're building for universal2.
7970
7977
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
7972
7979
[ LIBHACL_BLAKE2_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256_universal2.o"]
7973
7980
AC_MSG_RESULT ( [ universal2] )
7974
7981
else
0 commit comments