Skip to content

Commit 282dccb

Browse files
committed
Add wasm-opt wrapper
1 parent ebd3ffa commit 282dccb

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

recipes/recipes/emscripten_emscripten-wasm32/build_compiler_package.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@ for file in $PREFIX/opt/emsdk/upstream/emscripten/*; do
4848
ln -sf $file $PREFIX/bin/
4949
fi
5050
done
51+
52+
# Add wasm-opt wrapper. See NOTE in patches/wasm-opt-wrapper.
53+
EMSDK_DIR=$PREFIX/opt/emsdk/upstream
54+
mv $EMSDK_DIR/bin/wasm-opt $EMSDK_DIR/bin/wasm-opt-original
55+
cp $RECIPE_DIR/patches/wasm-opt-wrapper $EMSDK_DIR/bin/wasm-opt
56+
chmod +x $EMSDK_DIR/bin/wasm-opt
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# NOTE:
4+
# This is only required when using an external LLVM which is newer than the LLVM
5+
# version used by Emscripten; that is the case for packages using LLVM + Flang
6+
# such as Octave.
7+
# This wrapper should likely be removed once this package is upgraded to >3.1.73
8+
# The removal of these two flags should have no effect in any other packages
9+
# since these options are simply not supported (yet).
10+
11+
filtered_args=()
12+
for arg in "$@"; do
13+
if [[ "$arg" != "--enable-bulk-memory-opt" && "$arg" != "--enable-call-indirect-overlong" ]]; then
14+
filtered_args+=("$arg")
15+
fi
16+
done
17+
18+
$BUILD_PREFIX/opt/emsdk/upstream/bin/wasm-opt-original "${filtered_args[@]}"

recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ context:
33
version: 3.1.73
44

55
build:
6-
number: 10
6+
number: 11
77

88
outputs:
99
- package:

0 commit comments

Comments
 (0)