Commit 6c9cbc11 authored by Michael Droettboom's avatar Michael Droettboom Committed by GitHub

Merge pull request #89 from mdboom/update-emscripten

Update emscripten to 1.38.10
parents 757725bf b3d8e4c2
PYODIDE_ROOT=$(abspath .)
include Makefile.envs
FILEPACKAGER=emsdk/emsdk/emscripten/tag-1.38.4/tools/file_packager.py
FILEPACKAGER=emsdk/emsdk/emscripten/tag-1.38.10/tools/file_packager.py
CPYTHONROOT=cpython
CPYTHONLIB=$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/python$(PYMINOR)
......@@ -25,7 +25,7 @@ LDFLAGS=\
-s MAIN_MODULE=1 \
-s EMULATED_FUNCTION_POINTERS=1 \
-s EMULATE_FUNCTION_POINTER_CASTS=1 \
-s EXPORTED_FUNCTIONS='["_main", "__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv"]' \
-s EXPORTED_FUNCTIONS='["_main", "__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv", "__ZNSt11logic_errorC2EPKc"]' \
-s WASM=1 \
-s SWAPPABLE_ASM_MODULE=1 \
-s USE_FREETYPE=1 \
......
export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e-1.38.4/build_tag-e1.38.4_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.4:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.4_64bit_binaryen/bin:$(PATH)
export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e-1.38.10/build_tag-e1.38.10_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.10:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.10_64bit_binaryen/bin:$(PATH)
export EMSDK = $(PYODIDE_ROOT)/emsdk/emsdk
export EM_CONFIG = $(PYODIDE_ROOT)/emsdk/emsdk/.emscripten
export EM_CACHE = $(PYODIDE_ROOT)/emsdk/emsdk/.emscripten_cache
export EMSCRIPTEN = $(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.4
export BINARYEN_ROOT = $(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.4_64bit_binaryen
export EMSCRIPTEN = $(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.10
export BINARYEN_ROOT = $(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.10_64bit_binaryen
export PYVERSION=3.6.4
export PYMINOR=$(basename $(PYVERSION))
......
......@@ -9,15 +9,13 @@ emsdk/.complete:
sed -i -e "s#CPU_CORES = max(multiprocessing.cpu_count()-1, 1)#CPU_CORES = 3#g" emsdk/emsdk
( \
cd emsdk ; \
./emsdk install --build=Release sdk-tag-1.38.4-64bit binaryen-tag-1.38.4-64bit ; \
./emsdk install --build=Release sdk-tag-1.38.10-64bit binaryen-tag-1.38.10-64bit ; \
cd .. ; \
(cat patches/*.patch | patch -p1) ; \
cp files/* emsdk/emscripten/tag-1.38.4/src/ ; \
cd emsdk/binaryen/tag-1.38.4_64bit_binaryen/ ; \
cd emsdk/binaryen/tag-1.38.10_64bit_binaryen/ ; \
make ; \
cd ../.. ; \
cp binaryen/tag-1.38.4/bin/binaryen.js binaryen/tag-1.38.4_64bit_binaryen/bin ; \
./emsdk activate --embedded --build=Release sdk-tag-1.38.4-64bit binaryen-tag-1.38.4-64bit ; \
./emsdk activate --embedded --build=Release sdk-tag-1.38.10-64bit binaryen-tag-1.38.10-64bit ; \
touch .complete \
)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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 = [];
diff --git a/emsdk/binaryen/master/src/passes/FuncCastEmulation.cpp b/emsdk/binaryen/master/src/passes/FuncCastEmulation.cpp
index 013e9403..d95fc282 100644
--- a/emsdk/binaryen/tag-1.38.4/src/passes/FuncCastEmulation.cpp
+++ b/emsdk/binaryen/tag-1.38.4/src/passes/FuncCastEmulation.cpp
--- a/emsdk/binaryen/tag-1.38.10/src/passes/FuncCastEmulation.cpp
+++ b/emsdk/binaryen/tag-1.38.10/src/passes/FuncCastEmulation.cpp
@@ -39,7 +39,7 @@ namespace wasm {
// This should be enough for everybody. (As described above, we need this
// to match when dynamically linking, and also dynamic linking is why we
......@@ -10,4 +10,4 @@ index 013e9403..d95fc282 100644
+static const int NUM_PARAMS = 32;
// Converts a value to the ABI type of i64.
static Expression* toABI(Expression* value, Module* module) {
\ No newline at end of file
static Expression* toABI(Expression* value, Module* module) {
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment