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