You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--enable-wasm-dynamic-linking does not produce a dynamic build on WASI #163114
configure accepts --enable-wasm-dynamic-linking on WASI (gh-142234) and compiles with -fPIC, but sets no link flags. The LDSHARED branch says dnl not implemented yet and is unreachable. python.wasm stays a static executable and $(LDSHARED) cannot link an extension module (undefined symbol: PyModule_GetState). A working build needs LDSHARED and LINKFORSHARED passed through the environment.
On wasm32-wasip1: link python.wasm with -pie --import-memory --export-dynamic --export=__main_argc_argv, making it a main module of the tool-conventions dynamic linking ABI.
WASI 0.2+ links a component and is left alone. No C changes. The default build's link line is unchanged.
Tested
main, WASI SDK 34 and 33, --host=wasm32-wasip1 --enable-wasm-dynamic-linking, nothing else. Under a ~450-line Node loader for dylink.0:
xxlimited, _testmultiphase and _testsinglephase, linked with $(LDSHARED), import and work.
test_xxlimited passes. test_importlib.extension passes 34 of 37 once its is_wasi skip is lifted (two failures come from my case-insensitive host filesystem).
The default wasip1 build and a wasip3 build with the flag still run on Wasmtime.
Open question: testing
An earlier dlopen patch stalled because CPython could not test it without external tools. That still holds: Wasmtime does not load dylink.0 modules, and wasi-libc's dlopen is a stub.
CI builds with the flag: checks linking, not loading.
A test-only loader as the host runner, which I can contribute. It adds Node to CI.
Activity
pythongh-163114: Name the issue in the NEWS entry