@@ -8008,6 +8008,15 @@ AC_SUBST([LIBHACL_CFLAGS])
80088008LIBHACL_LDFLAGS= # for now, no specific linker flags are needed
80098009AC_SUBST ( [ LIBHACL_LDFLAGS] )
80108010
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+
80118020# The SIMD files use aligned_alloc, which is not available on older versions of
80128021# Android.
80138022# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
@@ -8025,7 +8034,7 @@ then
80258034 # available on x86_64. However, performance of the HACL SIMD128 implementation
80268035 # isn't great, so it's disabled on ARM64.
80278036 AC_MSG_CHECKING ( [ for HACL* SIMD128 implementation] )
8028- if test "$UNIVERSAL_ARCHS " == "universal2 "; then
8037+ if test "$use_hacl_universal2_impl " = "yes "; then
80298038 [ LIBHACL_BLAKE2_SIMD128_OBJS="Modules/_hacl/Hacl_Hash_Blake2s_Simd128_universal2.o"]
80308039 AC_MSG_RESULT ( [ universal2] )
80318040 else
@@ -8058,7 +8067,7 @@ then
80588067 # implementation requires symbols that aren't available on ARM64. Use a
80598068 # wrapped implementation if we're building for universal2.
80608069 AC_MSG_CHECKING ( [ for HACL* SIMD256 implementation] )
8061- if test "$UNIVERSAL_ARCHS " == "universal2 "; then
8070+ if test "$use_hacl_universal2_impl " = "yes "; then
80628071 [ LIBHACL_BLAKE2_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256_universal2.o"]
80638072 AC_MSG_RESULT ( [ universal2] )
80648073 else
0 commit comments