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
Emscripten: Trampoline doesn't work with emcc 4.0.19 due to table/memory visibility #145037
Since Emscripten 4.0.19 (released 11/04/25), -sRELOCATABLE is no longer the default when dynamic linking is enabled. This has substantial benefits to startup time because it eliminates all relocations. However, it also breaks the approach we've been using for Emscripten trampolines since #137470. In particular, we were relying on the fact that the memory and function pointer table are defined in JavaScript and imported by the main binary. With -sRELOCATABLE off, they are defined in the main binary and exported. It is possible with the -sIMPORTED_MEMORY setting to make the memory be defined in JS but there is no corresponding setting for the table. I discussed adding one in emscripten-core/emscripten#26217 but @sbc100 did not want to accept the increased maintenance burden without a more compelling reason.
To fix this, I will undo the change in approach that I made in #137470 and go back to using a function pointer for the trampoline.
Nope totally reasonable. It makes sense to not want to add a new feature without better justification for why the alternatives are not sufficient. And indeed I think this is good enough.
Activity
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19
sbc100 commentedon Feb 20, 2026
I hope your understand my reticence to add more emscripten features, and I don't appear too unreasonable here?
hoodmane commentedon Feb 21, 2026
Nope totally reasonable. It makes sense to not want to add a new feature without better justification for why the alternatives are not sufficient. And indeed I think this is good enough.
gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (#145038)
hoodmane commentedon Feb 26, 2026
Closed by #145038.
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (pytho…
[3.14] gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (GH-1…
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (pytho…
pythongh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (pytho…