Skip to content

gh-156780: Emscripten: drop the trampoline's dependence on exports - #157238

Open
clementperon wants to merge 1 commit into
python:mainfrom
clementperon:emscripten-trampoline-static
Open

gh-156780: Emscripten: drop the trampoline's dependence on exports#157238
clementperon wants to merge 1 commit into
python:mainfrom
clementperon:emscripten-trampoline-static

Conversation

@clementperon

Copy link
Copy Markdown
Contributor

Split out of #156781 as requested by @hoodmane.

The call trampoline exports _PyRuntime's address itself and takes over a placeholder's function table slot instead of calling addFunction(), so it no longer needs _PyRuntime in -sEXPORTED_FUNCTIONS or -sALLOW_TABLE_GROWTH. __PyRuntime is dropped from the interpreter's export list.

Tested with the CI configuration: the wasm-gc trampoline is picked up and test_capi, test_builtin, test_functools pass.

🤖 Generated with Claude Code

@clementperon

Copy link
Copy Markdown
Contributor Author

@freakboy3742 FYI

@hoodmane hoodmane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me, modulo a couple of comments.

Comment thread Misc/NEWS.d/next/Build/2026-09-09-21-10-00.gh-issue-156780.Kx7bYz.rst Outdated
Comment thread Python/emscripten_trampoline.c

@hoodmane hoodmane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me aside from a couple of comments.

@clementperon
clementperon force-pushed the emscripten-trampoline-static branch 3 times, most recently from 0c9e930 to fe2b470 Compare September 10, 2026 08:19
The trampoline exports _PyRuntime's address itself and reuses a
placeholder's table slot, so libpython no longer needs
-sEXPORTED_FUNCTIONS=__PyRuntime or a growable function table.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

2 participants