wasm: Add a nontrapping_bulk_memory_len0 feature.

This will mainly be used when targeting our wasm2c implementation which has no
problem with zero-length bulk memory operations, as a non-standard extension.
This commit is contained in:
Alex Rønne Petersen
2025-01-22 02:56:53 +01:00
parent 280ced66eb
commit ea1502974d
5 changed files with 60 additions and 30 deletions

View File

@@ -598,9 +598,10 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
.optimize = .ReleaseSmall,
.target = b.resolveTargetQuery(std.Target.Query.parse(.{
.arch_os_abi = "wasm32-wasi",
// `extended_const` is not supported by the `wasm-opt` version in CI.
// `nontrapping_fptoint` is not supported by `wasm2c`.
.cpu_features = "baseline-extended_const-nontrapping_fptoint",
// * `extended_const` is not supported by the `wasm-opt` version in CI.
// * `nontrapping_fptoint` is not supported by `wasm2c`.
// * `nontrapping_bulk_memory_len0` is supported by `wasm2c`.
.cpu_features = "baseline-extended_const-nontrapping_fptoint+nontrapping_bulk_memory_len0",
}) catch unreachable),
});