diff --git a/Misc/NEWS.d/next/Build/2026-03-21-18-51-31.gh-issue-146264.Q9Ej4m.rst b/Misc/NEWS.d/next/Build/2026-03-21-18-51-31.gh-issue-146264.Q9Ej4m.rst new file mode 100644 index 00000000000000..1fdafe560432a6 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-03-21-18-51-31.gh-issue-146264.Q9Ej4m.rst @@ -0,0 +1,3 @@ +Fix static module builds on non-WASI targets by linking HACL dependencies as +static libraries when ``MODULE_BUILDTYPE=static``, preventing duplicate +``_Py_LibHacl_*`` symbol errors at link time. diff --git a/configure b/configure index 7621eeabeb85db..1cc1d2a2a54dd4 100755 --- a/configure +++ b/configure @@ -32758,7 +32758,7 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HACL* library linking type" >&5 printf %s "checking for HACL* library linking type... " >&6; } -if test "$ac_sys_system" = "WASI"; then +if test "$ac_sys_system" = "WASI" || test "$MODULE_BUILDTYPE" = "static"; then LIBHACL_LDEPS_LIBTYPE=STATIC { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } diff --git a/configure.ac b/configure.ac index 21df2245402eea..21cef7a98181b6 100644 --- a/configure.ac +++ b/configure.ac @@ -8089,7 +8089,7 @@ AC_SUBST([LIBHACL_BLAKE2_SIMD256_OBJS]) # HACL*-based cryptographic primitives AC_MSG_CHECKING([for HACL* library linking type]) -if test "$ac_sys_system" = "WASI"; then +if test "$ac_sys_system" = "WASI" || test "$MODULE_BUILDTYPE" = "static"; then LIBHACL_LDEPS_LIBTYPE=STATIC AC_MSG_RESULT([static]) else