diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-01 20:39:33 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-01 20:39:33 +0200 |
| commit | c3b1f582f44747cb4343b51ffb208334c973c67c (patch) | |
| tree | 5a390555e495849110520a463e992dd2a390d7b5 /examples/rust | |
| parent | 0ed3e1d29dca7d27e0d3aa1780f7cacc9481aa46 (diff) | |
chore: cleanup + add wasm intrinsics
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'examples/rust')
| -rw-r--r-- | examples/rust/Cargo.toml | 2 | ||||
| -rwxr-xr-x | examples/rust/build.sh | 11 |
2 files changed, 4 insertions, 9 deletions
diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index da238ad..430bcad 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -48,7 +48,7 @@ path="src/argon2id.rs" [profile.wasm] opt-level=3 -lto="thin" +lto="fat" codegen-units=1 panic="abort" inherits="release" diff --git a/examples/rust/build.sh b/examples/rust/build.sh index 567ed56..9df5447 100755 --- a/examples/rust/build.sh +++ b/examples/rust/build.sh @@ -2,12 +2,11 @@ cd "$(dirname "$0")" || exit bins=("host_fn" "hello" "fibonacci" "print" "tinywasm" "argon2id") -exclude_wat=("tinywasm") out_dir="./target/wasm32-unknown-unknown/wasm" dest_dir="out" -rust_features="+simd128,+reference-types,+bulk-memory,+mutable-globals,+multivalue,+sign-ext,+nontrapping-fptoint" -wasmopt_features="--enable-simd --enable-reference-types --enable-bulk-memory --enable-mutable-globals --enable-multivalue --enable-sign-ext --enable-nontrapping-float-to-int" +rust_features="+sign-ext,+simd128,+reference-types,+bulk-memory,+bulk-memory-opt,+multimemory,+call-indirect-overlong,+mutable-globals,+multivalue,+sign-ext,+nontrapping-fptoint,+extended-const,+tail-call" +# wasmopt_features="--enable-reference-types --enable-bulk-memory --enable-mutable-globals --enable-multivalue --enable-sign-ext --enable-nontrapping-float-to-int" # ensure out dir exists mkdir -p "$dest_dir" @@ -20,9 +19,5 @@ for bin in "${bins[@]}"; do RUSTFLAGS="-C target-feature=$rust_features -C panic=abort" cargo build --target wasm32-unknown-unknown --package rust-wasm-examples --profile=wasm --bin "$bin" cp "$out_dir/$bin.wasm" "$dest_dir/" - wasm-opt "$dest_dir/$bin.wasm" -o "$dest_dir/$bin.opt.wasm" -O3 $wasmopt_features - - if [[ ! " ${exclude_wat[@]} " =~ " $bin " ]]; then - wasm2wat "$dest_dir/$bin.wasm" -o "$dest_dir/$bin.wat" - fi + # wasm-opt "$dest_dir/$bin.wasm" -o "$dest_dir/$bin.opt.wasm" -O3 $wasmopt_features done |
