Add a few things to EXPORTED_RUNTIME_METHODS (#4201)

Instead of patching them in `pre.js`
This commit is contained in:
Hood Chatham 2023-10-04 14:38:39 -07:00 committed by GitHub
parent aaab6a86d5
commit bb645ca9b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -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 \

View File

@ -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"];