Files
cpython/Programs/emscripten_beforemain.c
T
d6b77c8686 gh-156780: Emscripten: support building CPython with static linking (#156781)
Adds the ability to build Emscripten statically, so that it can be linked in as
an embedded library. Includes a test of the embedding case.
---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-10-22 19:58:32 +00:00

15 lines
404 B
C

/* Emscripten setup for when Python is the program. Linked into the
* interpreter only, never into libpython.
*
* Runs main() under WebAssembly.promising so that libpython can suspend the
* wasm stack in a syscall (see Python/emscripten_syscalls.c).
*/
void _PyEmscripten_BeforeMain_js(void);
__attribute__((constructor)) void
_PyEmscripten_BeforeMain(void)
{
_PyEmscripten_BeforeMain_js();
}