Skip to content

Commit

Permalink
Upgrade emscripten to 1.38.22
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jan 10, 2019
1 parent 75ed8c0 commit 4b3bfe5
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 141 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ build/pyodide.asm.js: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.b
[ -d build ] || mkdir build
$(CXX) -s EXPORT_NAME="'pyodide'" -o build/pyodide.asm.html $(filter %.bc,$^) \
$(LDFLAGS) -s FORCE_FILESYSTEM=1
rm build/pyodide.asm.asm.js
rm build/pyodide.asm.wasm.pre
rm build/pyodide.asm.html


Expand Down Expand Up @@ -149,7 +147,7 @@ build/test.data: $(CPYTHONLIB)
)
( \
cd build; \
python $(FILEPACKAGER) test.data --lz4 --preload ../$(CPYTHONLIB)/test@/lib/python3.7/test --js-output=test.js --export-name=pyodide._module --exclude \*.wasm.pre --exclude __pycache__ \
python $(FILEPACKAGER) test.data --lz4 --preload ../$(CPYTHONLIB)/test@/lib/python3.7/test --js-output=test.js --export-name=pyodide._module --exclude __pycache__ \
)
uglifyjs build/test.js -o build/test.js

Expand All @@ -174,7 +172,6 @@ root/.built: \
cd root/lib/python$(PYMINOR); \
rm -fr `cat ../../../remove_modules.txt`; \
rm -fr test; \
find . -name "*.wasm.pre" -type f -delete ; \
find -type d -name __pycache__ -prune -exec rm -rf {} \; \
)
touch root/.built
Expand All @@ -185,7 +182,7 @@ ccache/emcc:
if hash ccache &>/dev/null; then \
ln -s `which ccache` $(PYODIDE_ROOT)/ccache/emcc ; \
else \
ln -s emsdk/emsdk/emscripten/tag-1.38.12/emcc $(PYODIDE_ROOT)/ccache/emcc; \
ln -s emsdk/emsdk/emscripten/tag-$(EMSCRIPTEN_VERSION)/emcc $(PYODIDE_ROOT)/ccache/emcc; \
fi


Expand All @@ -194,7 +191,7 @@ ccache/em++:
if hash ccache &>/dev/null; then \
ln -s `which ccache` $(PYODIDE_ROOT)/ccache/em++ ; \
else \
ln -s emsdk/emsdk/emscripten/tag-1.38.12/em++ $(PYODIDE_ROOT)/ccache/em++; \
ln -s emsdk/emsdk/emscripten/tag-$(EMSCRIPTEN_VERSION)/em++ $(PYODIDE_ROOT)/ccache/em++; \
fi


Expand Down
8 changes: 5 additions & 3 deletions Makefile.envs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e1.38.12/build_tag-e1.38.12_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.12:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.12_64bit_binaryen/bin:$(PATH)
export EMSCRIPTEN_VERSION = 1.38.22

export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e$(EMSCRIPTEN_VERSION)/build_tag-e$(EMSCRIPTEN_VERSION)_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-$(EMSCRIPTEN_VERSION):$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-$(EMSCRIPTEN_VERSION)_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.12
export BINARYEN_ROOT = $(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.12_64bit_binaryen
export EMSCRIPTEN = $(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-$(EMSCRIPTEN_VERSION)
export BINARYEN_ROOT = $(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-$(EMSCRIPTEN_VERSION)_64bit_binaryen

export PYVERSION=3.7.0
export PYMINOR=$(basename $(PYVERSION))
Expand Down
20 changes: 12 additions & 8 deletions emsdk/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PYODIDE_ROOT=$(abspath ..)
include ../Makefile.envs

all: emsdk/.complete

# We hack the CPU_CORES, because if you use all of the cores on Circle-CI, you
Expand All @@ -8,14 +11,15 @@ emsdk/.complete:
git clone https://github.com/juj/emsdk.git
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.12-64bit binaryen-tag-1.38.12-64bit ; \
cd .. ; \
(cat patches/*.patch | patch -p1) ; \
cd emsdk/binaryen/tag-1.38.12_64bit_binaryen/ ; \
make ; \
cd ../.. ; \
./emsdk activate --embedded --build=Release sdk-tag-1.38.12-64bit binaryen-tag-1.38.12-64bit ; \
cd emsdk && \
./emsdk install --build=Release sdk-tag-$(EMSCRIPTEN_VERSION)-64bit binaryen-tag-$(EMSCRIPTEN_VERSION)-64bit && \
cd .. && \
(cat patches/*.patch | patch -p1) && \
cd emsdk/binaryen/tag-$(EMSCRIPTEN_VERSION)_64bit_binaryen/ && \
make && \
cd ../.. && \
cp binaryen/tag-$(EMSCRIPTEN_VERSION)/bin/wasm.js binaryen/tag-$(EMSCRIPTEN_VERSION)_64bit_binaryen/bin && \
./emsdk activate --embedded --build=Release sdk-tag-$(EMSCRIPTEN_VERSION)-64bit binaryen-tag-$(EMSCRIPTEN_VERSION)-64bit && \
touch .complete \
)

Expand Down
6 changes: 3 additions & 3 deletions emsdk/patches/lz4_c.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/emsdk/emscripten/tag-1.38.12/src/library_lz4.js b/emsdk/emscripten/tag-1.38.12/src/library_lz4.js
diff --git a/emsdk/emscripten/tag-1.38.22/src/library_lz4.js b/emsdk/emscripten/tag-1.38.22/src/library_lz4.js
index 4c3f583b7..5291002a4 100644
--- a/emsdk/emscripten/tag-1.38.12/src/library_lz4.js
+++ b/emsdk/emscripten/tag-1.38.12/src/library_lz4.js
--- a/emsdk/emscripten/tag-1.38.22/src/library_lz4.js
+++ b/emsdk/emscripten/tag-1.38.22/src/library_lz4.js
@@ -5,26 +5,14 @@ mergeInto(LibraryManager.library, {
DIR_MODE: {{{ cDefine('S_IFDIR') }}} | 511 /* 0777 */,
FILE_MODE: {{{ cDefine('S_IFREG') }}} | 511 /* 0777 */,
Expand Down
4 changes: 2 additions & 2 deletions emsdk/patches/num_params.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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.12/src/passes/FuncCastEmulation.cpp
+++ b/emsdk/binaryen/tag-1.38.12/src/passes/FuncCastEmulation.cpp
--- a/emsdk/binaryen/tag-1.38.22/src/passes/FuncCastEmulation.cpp
+++ b/emsdk/binaryen/tag-1.38.22/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
Expand Down
Loading

0 comments on commit 4b3bfe5

Please sign in to comment.