https://github.com/python/cpython/commit/0b3b154060936e1b120f5b9793ed3f8647df8480
commit: 0b3b154060936e1b120f5b9793ed3f8647df8480
branch: main
author: Clément Péron <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2026-09-08T15:26:48+08:00
summary:

gh-156780: Emscripten: add missing EM_JS_DEPS (#156798)

Explicitly declares some Javascript dependencies to support static builds.

Co-authored-by: Claude Opus 5 <[email protected]>

files:
M Python/emscripten_syscalls.c
M Python/emscripten_trampoline.c

diff --git a/Python/emscripten_syscalls.c b/Python/emscripten_syscalls.c
index 48ca208dedb14bb..cdd5fc6e91e89bc 100644
--- a/Python/emscripten_syscalls.c
+++ b/Python/emscripten_syscalls.c
@@ -132,6 +132,10 @@ EM_JS_MACROS(void, _emscripten_promising_main_js, (void), {
     };
 })
 
+EM_JS_DEPS(_emscripten_promising_main,
+           "$FS,$PATH,$FS_getMode,$resolveGlobalSymbol,"
+           "emscripten_exit_with_live_runtime");
+
 __attribute__((constructor)) void _emscripten_promising_main(void) {
     _emscripten_promising_main_js();
 }
@@ -199,6 +203,8 @@ EM_JS_MACROS(__externref_t, __maybe_fd_read_async, (
 };
 );
 
+EM_JS_DEPS(__maybe_fd_read_async, "$SYSCALLS");
+
 // Bind original fd_read syscall to __wasi_fd_read_orig().
 __wasi_errno_t __wasi_fd_read_orig(__wasi_fd_t fd, const __wasi_iovec_t *iovs,
                                    size_t iovs_len, __wasi_size_t *nread)
@@ -280,6 +286,8 @@ EM_JS_MACROS(__externref_t, __maybe_poll_async, (intptr_t 
fds, int nfds, int tim
     })();
 });
 
+EM_JS_DEPS(__maybe_poll_async, "$FS");
+
 // Bind original poll syscall to syscall_poll_orig().
 int syscall_poll_orig(intptr_t fds, int nfds, int timeout)
     __attribute__((__import_module__("env"),
diff --git a/Python/emscripten_trampoline.c b/Python/emscripten_trampoline.c
index 1833311ca74d9dd..75cfde6b76f2174 100644
--- a/Python/emscripten_trampoline.c
+++ b/Python/emscripten_trampoline.c
@@ -94,6 +94,9 @@ addOnPreRun(function setEmscriptenTrampoline() {
 });
 );
 
+EM_JS_DEPS(_PyEM_TrampolineCall,
+           "$wasmTable,$wasmMemory,$addFunction,$addOnPreRun");
+
 PyObject*
 _PyEM_TrampolineCall(PyCFunctionWithKeywords func,
                      PyObject* self,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to