Skip to content

Commit

Permalink
Update to emscripten 1.38.44 (pyodide#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcde authored Dec 21, 2020
1 parent 77b2a99 commit 9472852
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile.envs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export EMSCRIPTEN_VERSION = 1.38.43
export EMSCRIPTEN_VERSION = 1.38.44
export BINARYEN_VERSION = version_84

export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/node/12.18.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/bin/:$(PYODIDE_ROOT)/emsdk/emsdk/fastcomp/emscripten/:$(PATH)
Expand Down
30 changes: 14 additions & 16 deletions emsdk/patches/dynCall_so.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
diff --git a/emsdk/fastcomp/emscripten/src/support.js b/emsdk/fastcomp/emscripten/src/support.js
index 8e1df8e82..4d07d6bef 100644
--- a/emsdk/fastcomp/emscripten/src/support.js
+++ b/emsdk/fastcomp/emscripten/src/support.js
@@ -471,7 +471,18 @@
@@ -338,6 +338,11 @@ function relocateExports(exports, memoryBase, tableBase, moduleLocal) {
}
#endif
}
+ if (e.startsWith("dynCall_")) {
+ if (!Module.hasOwnProperty(e)) {
+ Module[e] = value;
+ }
+ }
relocated[e] = value;
if (moduleLocal) {
#if WASM_BACKEND
@@ -510,7 +515,18 @@ function loadWebAssemblyModule(binary, flags) {
// present in the dynamic library but not in the main JS,
// and the dynamic library cannot provide JS for it. Use
// the generic "X" invoke for it.
- return obj[prop] = invoke_X;
+ var dynCallName = 'dynCall_' + prop.slice(7);
+ return obj[prop] = function() {
+ var sp = stackSave();
+ try {
+ try {
+ var args = Array.prototype.slice.call(arguments);
+ return Module[dynCallName].apply(null, args);
+ } catch(e) {
Expand All @@ -22,15 +32,3 @@ index 8e1df8e82..4d07d6bef 100644
}
// otherwise this is regular function import - call it indirectly
return obj[prop] = function() {
@@ -530,6 +541,11 @@
}
#endif
}
+ if (e.startsWith("dynCall_")) {
+ if (!Module.hasOwnProperty(e)) {
+ Module[e] = value;
+ }
+ }
exports[e] = value;
#if WASM_BACKEND
moduleLocal['_' + e] = value;

0 comments on commit 9472852

Please sign in to comment.