summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-06-14 18:54:10 -0700
committerGitHub <noreply@github.com>2018-06-14 18:54:10 -0700
commite43526589eb88c708fa381ad7eed40d173c9992f (patch)
treee80f84b2cb120568c84550cd97bbe6ebacfda374
parentaab16136b9752eb0586b3a5b32b1d0e7a5803835 (diff)
downloadbinaryen-e43526589eb88c708fa381ad7eed40d173c9992f.tar.gz
binaryen-e43526589eb88c708fa381ad7eed40d173c9992f.tar.bz2
binaryen-e43526589eb88c708fa381ad7eed40d173c9992f.zip
Build js files with errors on undefined symbols (#1600)
* build js files with errors on undefined symbols, to make sure we never regress it * add a missing file, the wasm intrinsics * generate wasm intrinsics in build-js.sh
-rwxr-xr-xbuild-js.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/build-js.sh b/build-js.sh
index 64c864595..763062a19 100755
--- a/build-js.sh
+++ b/build-js.sh
@@ -42,6 +42,7 @@ EMCC_ARGS="$EMCC_ARGS -s ALLOW_MEMORY_GROWTH=1"
EMCC_ARGS="$EMCC_ARGS -s DEMANGLE_SUPPORT=1"
EMCC_ARGS="$EMCC_ARGS -s NO_FILESYSTEM=1"
EMCC_ARGS="$EMCC_ARGS -s WASM=0"
+EMCC_ARGS="$EMCC_ARGS -s ERROR_ON_UNDEFINED_SYMBOLS=1"
# TODO: enable this (need nearbyint in emscripten tag) EMCC_ARGS="$EMCC_ARGS -s ERROR_ON_UNDEFINED_SYMBOLS=1"
EMCC_ARGS="$EMCC_ARGS -s DISABLE_EXCEPTION_CATCHING=0" # Exceptions are thrown and caught when optimizing endless loops
OUT_FILE_SUFFIX=
@@ -63,9 +64,16 @@ fi
# input sources relative to this script
BINARYEN_SRC="$(dirname $0)/src"
+# input sources relative to this script
+BINARYEN_SCRIPTS="$(dirname $0)/scripts"
+
# output binaries relative to current working directory
BINARYEN_BIN="$PWD/bin"
+echo "generate embedded intrinsics module"
+
+python $BINARYEN_SCRIPTS/embedwast.py $BINARYEN_SRC/passes/wasm-intrinsics.wast $BINARYEN_SRC/passes/WasmIntrinsics.cpp
+
echo "building shared bitcode"
"$EMSCRIPTEN/em++" \
@@ -126,6 +134,7 @@ echo "building shared bitcode"
$BINARYEN_SRC/passes/TrapMode.cpp \
$BINARYEN_SRC/passes/Untee.cpp \
$BINARYEN_SRC/passes/Vacuum.cpp \
+ $BINARYEN_SRC/passes/WasmIntrinsics.cpp \
$BINARYEN_SRC/support/bits.cpp \
$BINARYEN_SRC/support/colors.cpp \
$BINARYEN_SRC/support/file.cpp \