diff --git a/emsdk/patches/float-remainder-in-side-module.patch b/emsdk/patches/float-remainder-in-side-module.patch new file mode 100644 index 000000000..945e28f2f --- /dev/null +++ b/emsdk/patches/float-remainder-in-side-module.patch @@ -0,0 +1,38 @@ +index f6c9842ff..9f83181eb 100644 +--- a/emsdk/emscripten/tag-1.38.4/src/support.js ++++ b/emsdk/emscripten/tag-1.38.4/src/support.js +@@ -158,7 +158,33 @@ function loadWebAssemblyModule(binary) { + 'Infinity': Infinity, + }, + 'global.Math': Math, +- env: env ++ env: env, ++ 'asm2wasm': { // special asm2wasm imports ++ "f64-rem": function(x, y) { ++ return x % y; ++ }, ++ "debugger": function() { ++ debugger; ++ } ++#if NEED_ALL_ASM2WASM_IMPORTS ++ , ++ "f64-to-int": function(x) { ++ return x | 0; ++ }, ++ "i32s-div": function(x, y) { ++ return ((x | 0) / (y | 0)) | 0; ++ }, ++ "i32u-div": function(x, y) { ++ return ((x >>> 0) / (y >>> 0)) >>> 0; ++ }, ++ "i32s-rem": function(x, y) { ++ return ((x | 0) % (y | 0)) | 0; ++ }, ++ "i32u-rem": function(x, y) { ++ return ((x >>> 0) % (y >>> 0)) >>> 0; ++ } ++#endif // NEED_ALL_ASM2WASM_IMPORTS ++ }, + }; + #if ASSERTIONS + var oldTable = [];