@@ -8001,6 +8001,15 @@ AC_SUBST([LIBHACL_CFLAGS])
8001
8001
LIBHACL_LDFLAGS= # for now, no specific linker flags are needed
8002
8002
AC_SUBST ( [ LIBHACL_LDFLAGS] )
8003
8003
8004
+ dnl Check if universal2 HACL* implementation should be used.
8005
+ if test "$UNIVERSAL_ARCHS" = "universal2" -o \
8006
+ \( "$build_cpu" = "aarch64" -a "$build_vendor" = "apple" \)
8007
+ then
8008
+ use_hacl_universal2_impl=yes
8009
+ else
8010
+ use_hacl_universal2_impl=no
8011
+ fi
8012
+
8004
8013
# The SIMD files use aligned_alloc, which is not available on older versions of
8005
8014
# Android.
8006
8015
# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
@@ -8017,7 +8026,7 @@ then
8017
8026
# available on x86_64. However, performance of the HACL SIMD128 implementation
8018
8027
# isn't great, so it's disabled on ARM64.
8019
8028
AC_MSG_CHECKING ( [ for HACL* SIMD128 implementation] )
8020
- if test "$UNIVERSAL_ARCHS " == "universal2 "; then
8029
+ if test "$use_hacl_universal2_impl " = "yes "; then
8021
8030
[ LIBHACL_BLAKE2_SIMD128_OBJS="Modules/_hacl/Hacl_Hash_Blake2s_Simd128_universal2.o"]
8022
8031
AC_MSG_RESULT ( [ universal2] )
8023
8032
else
@@ -8049,7 +8058,7 @@ then
8049
8058
# implementation requires symbols that aren't available on ARM64. Use a
8050
8059
# wrapped implementation if we're building for universal2.
8051
8060
AC_MSG_CHECKING ( [ for HACL* SIMD256 implementation] )
8052
- if test "$UNIVERSAL_ARCHS " == "universal2 "; then
8061
+ if test "$use_hacl_universal2_impl " = "yes "; then
8053
8062
[ LIBHACL_BLAKE2_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256_universal2.o"]
8054
8063
AC_MSG_RESULT ( [ universal2] )
8055
8064
else
0 commit comments