From 9472852450c5afc6ebbbb8d56f10b3a43284cbca Mon Sep 17 00:00:00 2001 From: Dexter Chua Date: Mon, 21 Dec 2020 13:00:05 +0800 Subject: [PATCH] Update to emscripten 1.38.44 (#906) --- Makefile.envs | 2 +- emsdk/patches/dynCall_so.patch | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Makefile.envs b/Makefile.envs index 5f40c73e5..fbf0554a3 100644 --- a/Makefile.envs +++ b/Makefile.envs @@ -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) diff --git a/emsdk/patches/dynCall_so.patch b/emsdk/patches/dynCall_so.patch index 81815717d..9641d5868 100644 --- a/emsdk/patches/dynCall_so.patch +++ b/emsdk/patches/dynCall_so.patch @@ -1,8 +1,18 @@ -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. @@ -10,7 +20,7 @@ index 8e1df8e82..4d07d6bef 100644 + 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) { @@ -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;