Skip to content

Commit e435265

Browse files
authored
Build js files with errors on undefined symbols (WebAssembly#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
1 parent aab1613 commit e435265

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

build-js.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ EMCC_ARGS="$EMCC_ARGS -s ALLOW_MEMORY_GROWTH=1"
4242
EMCC_ARGS="$EMCC_ARGS -s DEMANGLE_SUPPORT=1"
4343
EMCC_ARGS="$EMCC_ARGS -s NO_FILESYSTEM=1"
4444
EMCC_ARGS="$EMCC_ARGS -s WASM=0"
45+
EMCC_ARGS="$EMCC_ARGS -s ERROR_ON_UNDEFINED_SYMBOLS=1"
4546
# TODO: enable this (need nearbyint in emscripten tag) EMCC_ARGS="$EMCC_ARGS -s ERROR_ON_UNDEFINED_SYMBOLS=1"
4647
EMCC_ARGS="$EMCC_ARGS -s DISABLE_EXCEPTION_CATCHING=0" # Exceptions are thrown and caught when optimizing endless loops
4748
OUT_FILE_SUFFIX=
@@ -63,9 +64,16 @@ fi
6364
# input sources relative to this script
6465
BINARYEN_SRC="$(dirname $0)/src"
6566

67+
# input sources relative to this script
68+
BINARYEN_SCRIPTS="$(dirname $0)/scripts"
69+
6670
# output binaries relative to current working directory
6771
BINARYEN_BIN="$PWD/bin"
6872

73+
echo "generate embedded intrinsics module"
74+
75+
python $BINARYEN_SCRIPTS/embedwast.py $BINARYEN_SRC/passes/wasm-intrinsics.wast $BINARYEN_SRC/passes/WasmIntrinsics.cpp
76+
6977
echo "building shared bitcode"
7078

7179
"$EMSCRIPTEN/em++" \
@@ -126,6 +134,7 @@ echo "building shared bitcode"
126134
$BINARYEN_SRC/passes/TrapMode.cpp \
127135
$BINARYEN_SRC/passes/Untee.cpp \
128136
$BINARYEN_SRC/passes/Vacuum.cpp \
137+
$BINARYEN_SRC/passes/WasmIntrinsics.cpp \
129138
$BINARYEN_SRC/support/bits.cpp \
130139
$BINARYEN_SRC/support/colors.cpp \
131140
$BINARYEN_SRC/support/file.cpp \

0 commit comments

Comments
 (0)