From bb645ca9b4f13d2243b8753ae77e3aeaeeb02f8e Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Wed, 4 Oct 2023 14:38:39 -0700 Subject: [PATCH] Add a few things to EXPORTED_RUNTIME_METHODS (#4201) Instead of patching them in `pre.js` --- Makefile.envs | 2 +- src/core/_pyodide_core.c | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Makefile.envs b/Makefile.envs index 1a05e174e..0ce41fc6d 100644 --- a/Makefile.envs +++ b/Makefile.envs @@ -121,7 +121,7 @@ export MAIN_MODULE_LDFLAGS= $(LDFLAGS_BASE) \ -s EXPORT_NAME="'_createPyodideModule'" \ -s EXPORT_EXCEPTION_HANDLING_HELPERS \ -s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules'] \ - -sEXPORTED_RUNTIME_METHODS='stackAlloc,stackRestore,stackSave' \ + -sEXPORTED_RUNTIME_METHODS='wasmTable,ERRNO_CODES' \ -s DEMANGLE_SUPPORT=1 \ -s USE_ZLIB \ -s USE_BZIP2 \ diff --git a/src/core/_pyodide_core.c b/src/core/_pyodide_core.c index ad9ae8ae2..d4c30e116 100644 --- a/src/core/_pyodide_core.c +++ b/src/core/_pyodide_core.c @@ -39,17 +39,11 @@ static struct PyModuleDef core_module_def = { .m_size = -1, }; +EM_JS_DEPS(pyodide_core_deps, "stackAlloc,stackRestore,stackSave"); PyObject* PyInit__pyodide_core(void) { EM_ASM({ - // Emscripten doesn't make UTF8ToString or wasmTable available on Module by - // default... - Module.UTF8ToString = UTF8ToString; - Module.wasmTable = wasmTable; - // Emscripten has a bug where it accidentally exposes an empty object as - // Module.ERRNO_CODES - Module.ERRNO_CODES = ERRNO_CODES; // sourmash needs open64 to mean the same thing as open. // Emscripten 3.1.44 seems to have removed it?? wasmImports["open64"] = wasmImports["open"];