summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2024-11-06 22:33:46 (GMT)
committerGitHub <noreply@github.com>2024-11-06 22:33:46 (GMT)
commit2a6b6b33dfe0f3c435abf2829b62ef3f1ef12cd3 (patch)
tree36ac3fc5cb589b589cac2c8780a248d27c690ebd /configure.ac
parent5dc36dc5658f6ba9cfd9d7a2771baaf17d2ee23a (diff)
downloadcpython-2a6b6b33dfe0f3c435abf2829b62ef3f1ef12cd3.zip
cpython-2a6b6b33dfe0f3c435abf2829b62ef3f1ef12cd3.tar.gz
cpython-2a6b6b33dfe0f3c435abf2829b62ef3f1ef12cd3.tar.bz2
GH-126458: disable SIMD for HACL under WASI (#126512)
Requires an extra `-msimd128` flag and the `*mmintrin.h` header files are exclusive to x86-family CPUs.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index bc67a05..da7d1ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7853,7 +7853,8 @@ AC_SUBST([LIBHACL_CFLAGS])
# The SIMD files use aligned_alloc, which is not available on older versions of
# Android.
-if test "$ac_sys_system" != "Linux-android" || test "$ANDROID_API_LEVEL" -ge 28; then
+# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
+if test "$ac_sys_system" != "Linux-android" -a "$ac_sys_system" != "WASI" || test "$ANDROID_API_LEVEL" -ge 28; then
dnl This can be extended here to detect e.g. Power8, which HACL* should also support.
AX_CHECK_COMPILE_FLAG([-msse -msse2 -msse3 -msse4.1 -msse4.2],[
[LIBHACL_SIMD128_FLAGS="-msse -msse2 -msse3 -msse4.1 -msse4.2"]
@@ -7879,11 +7880,12 @@ AC_SUBST([LIBHACL_SIMD128_OBJS])
# The SIMD files use aligned_alloc, which is not available on older versions of
# Android.
+# The *mmintrin.h headers are x86-family-specific, so can't be used on WASI.
#
# Although AVX support is not guaranteed on Android
# (https://developer.android.com/ndk/guides/abis#86-64), this is safe because we do a
# runtime CPUID check.
-if test "$ac_sys_system" != "Linux-android" || test "$ANDROID_API_LEVEL" -ge 28; then
+if test "$ac_sys_system" != "Linux-android" -a "$ac_sys_system" != "WASI" || test "$ANDROID_API_LEVEL" -ge 28; then
AX_CHECK_COMPILE_FLAG([-mavx2],[
[LIBHACL_SIMD256_FLAGS="-mavx2"]
AC_DEFINE([HACL_CAN_COMPILE_SIMD256], [1], [HACL* library can compile SIMD256 implementations])