Skip to content

gh-163114: Make --enable-wasm-dynamic-linking work for WASI 0.1 - #163117

Open
Yousef02 wants to merge 2 commits into
python:mainfrom
Yousef02:wasi-dynamic-linking
Open

Yousef02 wants to merge 2 commits into
python:mainfrom
Yousef02:wasi-dynamic-linking

Conversation

@Yousef02

@Yousef02 Yousef02 commented Dec 3, 2026 •

Copy link
Copy Markdown

configure accepted the option on WASI but set no link flags.

  • LDSHARED now imports a module's undefined symbols (--unresolved-symbols=import-dynamic). The branch meant to set it was unreachable.
  • On wasm32-wasip1, python.wasm is linked as a position-independent executable that imports its memory and exports its symbols. WASI 0.2+ links a component and is not changed.

The default build's link line is unchanged. Running the result needs a host-side dynamic loader, so CI cannot exercise dlopen yet. See the issue for what was tested and the testing question.

configure was regenerated with Tools/build/regen-configure.sh.

🤖 Generated with Claude Code

Yousef02 and others added 2 commits December 3, 2026 13:33
configure accepted the option for WASI but left the link flags
unimplemented, so they had to be supplied through the environment.

* LDSHARED imports a module's undefined symbols instead of failing on
  them, so the dynamic loader can resolve them. The branch that was meant
  to set it was unreachable.
* On wasm32-wasip1, python.wasm is linked as a position-independent
  executable that imports its memory and exports its symbols. Later WASI
  versions link a component and are left as they are.

The default build is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@python-cla-bot

python-cla-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · cpython-previews · built Dec. 3, 2026, 10:09 p.m. UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant