Skip to content

Commit 9526653

Browse files
authored
Rollup merge of #97808 - alexcrichton:wasm-features, r=petrochenkov
Add some unstable target features for the wasm target codegen I was experimenting with cross-language LTO for the wasm target recently between Rust and C and found that C was injecting the `+mutable-globals` flag on all functions. When specifying the corresponding `-Ctarget-feature=+mutable-globals` feature to Rust it prints a warning about an unknown feature. I've added the `mutable-globals` feature plus another few I know of to the list of known features for wasm targets. These features all continue to be unstable to source code as they were before.
2 parents f32a4f0 + ff37001 commit 9526653

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_codegen_ssa/src/target_features.rs

+3
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ const WASM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
246246
("simd128", None),
247247
("atomics", Some(sym::wasm_target_feature)),
248248
("nontrapping-fptoint", Some(sym::wasm_target_feature)),
249+
("bulk-memory", Some(sym::wasm_target_feature)),
250+
("mutable-globals", Some(sym::wasm_target_feature)),
251+
("reference-types", Some(sym::wasm_target_feature)),
249252
];
250253

251254
const BPF_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[("alu32", Some(sym::bpf_target_feature))];

0 commit comments

Comments
 (0)