Skip to content

Commit ac75110

Browse files
authored
gh-130478: fix HACL* build for macOS Silicon (#134188)
1 parent f806463 commit ac75110

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

configure

Lines changed: 10 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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8001,6 +8001,15 @@ AC_SUBST([LIBHACL_CFLAGS])
80018001
LIBHACL_LDFLAGS= # for now, no specific linker flags are needed
80028002
AC_SUBST([LIBHACL_LDFLAGS])
80038003

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+
80048013
# The SIMD files use aligned_alloc, which is not available on older versions of
80058014
# Android.
80068015
# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
@@ -8017,7 +8026,7 @@ then
80178026
# available on x86_64. However, performance of the HACL SIMD128 implementation
80188027
# isn't great, so it's disabled on ARM64.
80198028
AC_MSG_CHECKING([for HACL* SIMD128 implementation])
8020-
if test "$UNIVERSAL_ARCHS" == "universal2"; then
8029+
if test "$use_hacl_universal2_impl" = "yes"; then
80218030
[LIBHACL_BLAKE2_SIMD128_OBJS="Modules/_hacl/Hacl_Hash_Blake2s_Simd128_universal2.o"]
80228031
AC_MSG_RESULT([universal2])
80238032
else
@@ -8049,7 +8058,7 @@ then
80498058
# implementation requires symbols that aren't available on ARM64. Use a
80508059
# wrapped implementation if we're building for universal2.
80518060
AC_MSG_CHECKING([for HACL* SIMD256 implementation])
8052-
if test "$UNIVERSAL_ARCHS" == "universal2"; then
8061+
if test "$use_hacl_universal2_impl" = "yes"; then
80538062
[LIBHACL_BLAKE2_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256_universal2.o"]
80548063
AC_MSG_RESULT([universal2])
80558064
else

0 commit comments

Comments
 (0)