diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-06-07 11:41:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-07 11:41:09 +0200 |
| commit | 95266530d5b97a51b4ad110733fa276f85c27b43 (patch) | |
| tree | 5bdccc6cc756e360cc4bbc4613b9c8522af522c6 | |
| parent | f32a4f06aba4aab085fe50490c8d70ce66fb7bdf (diff) | |
| parent | ff3700171316bb59e571e1b8604efba191bdb1c0 (diff) | |
| download | rust-95266530d5b97a51b4ad110733fa276f85c27b43.tar.gz rust-95266530d5b97a51b4ad110733fa276f85c27b43.zip | |
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.
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/target_features.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index ba1e1862227..bfdef2dc0e8 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -246,6 +246,9 @@ const WASM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[ ("simd128", None), ("atomics", Some(sym::wasm_target_feature)), ("nontrapping-fptoint", Some(sym::wasm_target_feature)), + ("bulk-memory", Some(sym::wasm_target_feature)), + ("mutable-globals", Some(sym::wasm_target_feature)), + ("reference-types", Some(sym::wasm_target_feature)), ]; const BPF_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[("alu32", Some(sym::bpf_target_feature))]; |
