Skip to content

Commit

Permalink
Disable HACL SIMD256 on universal builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Sep 11, 2024
1 parent 00ffdf2 commit 6ec0833
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HACL* Blake2 SIMD256 has been disabled for universal2 builds on macOS.
9 changes: 7 additions & 2 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7813,9 +7813,14 @@ AC_SUBST([LIBHACL_SIMD128_FLAGS])
AC_SUBST([LIBHACL_SIMD128_OBJS])

AX_CHECK_COMPILE_FLAG([-mavx2],[
[LIBHACL_SIMD256_FLAGS="-mavx2"]
[LIBHACL_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256.o"]
AC_DEFINE([HACL_CAN_COMPILE_SIMD256], [1], [HACL* library can compile SIMD256 implementations])
# macOS universal2 builds *support* the -mavx2 compiler flag because it's
# available on x86_64; but the HACL SIMD256 build then fails because the
# implementation requires symbols that aren't available on ARM64.
if test "$UNIVERSAL_ARCHS" != "universal2"; then
[LIBHACL_SIMD256_FLAGS="-mavx2"]
[LIBHACL_SIMD256_OBJS="Modules/_hacl/Hacl_Hash_Blake2b_Simd256.o"]
AC_DEFINE([HACL_CAN_COMPILE_SIMD256], [1], [HACL* library can compile SIMD256 implementations])
fi
], [], [-Werror])

AC_SUBST([LIBHACL_SIMD256_FLAGS])
Expand Down

0 comments on commit 6ec0833

Please sign in to comment.