Always add -enable-sign-ext to the wasm-opt command-line

At least LLVM 18 seems to emit these instructions by default.
This commit is contained in:
Frank Denis
2024-05-19 13:04:29 +02:00
parent b582d20ab4
commit c9c34fb31f
+9 -8
View File
@@ -4,7 +4,8 @@ unset LDFLAGS
unset CFLAGS
if command -v wasm-opt >/dev/null; then
wasm-opt -O4 -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1"
wasm-opt -O4 --enable-sign-ext --emit-target-features $WASMOPT_FLAGS \
-o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1"
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then
@@ -71,15 +72,15 @@ fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then
if command -v iwasm >/dev/null; then
if iwasm | grep -qi wasi >/dev/null 2>&1; then
if wamrc --version; then
wamrc -o "${1}.o" "$1" >/dev/null &&
iwasm --dir=. "${1}.o" && exit 0
else
iwasm --dir=. "$1" && exit 0
if iwasm | grep -qi wasi >/dev/null 2>&1; then
if wamrc --version; then
wamrc -o "${1}.o" "$1" >/dev/null &&
iwasm --dir=. "${1}.o" && exit 0
else
iwasm --dir=. "$1" && exit 0
fi
fi
fi
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wazero" ]; then