Skip to content

Commit c903381

Browse files
committed
Inform HACL whether explicit_bzero is available
1 parent f84754b commit c903381

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ LIBMPDEC_A= Modules/_decimal/libmpdec/libmpdec.a
222222
LIBEXPAT_A= Modules/expat/libexpat.a
223223
LIBHACL_SHA2_A= Modules/_hacl/libHacl_Hash_SHA2.a
224224
LIBHACL_BLAKE2_A= Modules/_hacl/libHacl_Hash_Blake2.a
225+
LIBHACL_CFLAGS=@LIBHACL_CFLAGS@
225226
LIBHACL_SIMD128_FLAGS=@LIBHACL_SIMD128_FLAGS@
226227
LIBHACL_SIMD256_FLAGS=@LIBHACL_SIMD256_FLAGS@
227228
LIBHACL_SIMD128_OBJS=@LIBHACL_SIMD128_OBJS@
@@ -1368,7 +1369,6 @@ $(LIBEXPAT_A): $(LIBEXPAT_OBJS)
13681369
# Build HACL* static libraries for hashlib: libHacl_Hash_SHA2.a, and
13691370
# libHacl_Blake2.a -- the contents of the latter vary depending on whether we
13701371
# have the ability to compile vectorized versions
1371-
LIBHACL_CFLAGS=-I$(srcdir)/Modules/_hacl -I$(srcdir)/Modules/_hacl/include -D_BSD_SOURCE -D_DEFAULT_SOURCE $(PY_STDMODULE_CFLAGS) $(CCSHARED)
13721372

13731373
Modules/_hacl/Hacl_Hash_SHA2.o: $(srcdir)/Modules/_hacl/Hacl_Hash_SHA2.c $(LIBHACL_SHA2_HEADERS)
13741374
$(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_SHA2.c

configure

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7764,6 +7764,16 @@ PY_STDLIB_MOD([_sha2], [test "$with_builtin_sha2" = yes])
77647764
PY_STDLIB_MOD([_sha3], [test "$with_builtin_sha3" = yes])
77657765
PY_STDLIB_MOD([_blake2], [test "$with_builtin_blake2" = yes])
77667766

7767+
LIBHACL_CFLAGS='-I$(srcdir)/Modules/_hacl -I$(srcdir)/Modules/_hacl/include -D_BSD_SOURCE -D_DEFAULT_SOURCE $(PY_STDMODULE_CFLAGS) $(CCSHARED)'
7768+
case "$ac_sys_system" in
7769+
Linux*)
7770+
if test "$ac_cv_func_explicit_bzero" = "no"; then
7771+
LIBHACL_CFLAGS="$LIBHACL_CFLAGS -DLINUX_NO_EXPLICIT_BZERO"
7772+
fi
7773+
;;
7774+
esac
7775+
AC_SUBST([LIBHACL_CFLAGS])
7776+
77677777
dnl This can be extended here to detect e.g. Power8, which HACL* should also support.
77687778
AX_CHECK_COMPILE_FLAG([-msse -msse2 -msse3 -msse4.1 -msse4.2],[
77697779
[LIBHACL_SIMD128_FLAGS="-msse -msse2 -msse3 -msse4.1 -msse4.2"]

0 commit comments

Comments
 (0)