https://github.com/python/cpython/commit/eba449a1989265a923174142dd67dee074f90967
commit: eba449a1989265a923174142dd67dee074f90967
branch: main
author: Brett Cannon <[email protected]>
committer: brettcannon <[email protected]>
date: 2025-12-05T23:27:16Z
summary:

GH-142234: Allow `--enable-wasm-dynamic-linking` under WASI (GH-142235)

While CPython doesn't support `--enable-wasm-dynamic-linking`, external tools 
like componentize-py do and they have to patch around it. Since the flag is off 
by default, allowing the flag so external users can add/inject dynamic linking 
support seems acceptable.

files:
A Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst
M configure
M configure.ac

diff --git 
a/Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst 
b/Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst
new file mode 100644
index 00000000000000..a586512fc0a80b
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst
@@ -0,0 +1,3 @@
+Allow ``--enable-wasm-dynamic-linking`` for WASI. While CPython doesn't
+directly support it so external/downstream users do not have to patch in
+support for the flag.
diff --git a/configure b/configure
index 1561f7f4134ac2..7561fb9c7ad90e 100755
--- a/configure
+++ b/configure
@@ -1824,7 +1824,8 @@ Optional Features:
                           no)
   --enable-wasm-dynamic-linking
                           Enable dynamic linking support for WebAssembly
-                          (default is no)
+                          (default is no); WASI requires an external dynamic
+                          loader to handle imports
   --enable-wasm-pthreads  Enable pthread emulation for WebAssembly (default is
                           no)
   --enable-shared         enable building a shared Python library (default is
@@ -7415,7 +7416,7 @@ then :
   Emscripten) :
      ;; #(
   WASI) :
-    as_fn_error $? "WASI dynamic linking is not implemented yet." "$LINENO" 5 
;; #(
+     ;; #(
   *) :
     as_fn_error $? "--enable-wasm-dynamic-linking only applies to Emscripten 
and WASI" "$LINENO" 5
    ;;
diff --git a/configure.ac b/configure.ac
index f2a7319d22d24b..fa24bc78a2645a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1323,11 +1323,11 @@ dnl See 
https://emscripten.org/docs/compiling/Dynamic-Linking.html
 AC_MSG_CHECKING([for --enable-wasm-dynamic-linking])
 AC_ARG_ENABLE([wasm-dynamic-linking],
   [AS_HELP_STRING([--enable-wasm-dynamic-linking],
-                  [Enable dynamic linking support for WebAssembly (default is 
no)])],
+                  [Enable dynamic linking support for WebAssembly (default is 
no); WASI requires an external dynamic loader to handle imports])],
 [
   AS_CASE([$ac_sys_system],
     [Emscripten], [],
-    [WASI], [AC_MSG_ERROR([WASI dynamic linking is not implemented yet.])],
+    [WASI], [],
     [AC_MSG_ERROR([--enable-wasm-dynamic-linking only applies to Emscripten 
and WASI])]
   )
 ], [

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to