about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2022-06-06 15:01:17 -0700
committerAlex Crichton <alex@alexcrichton.com>2022-06-06 15:01:17 -0700
commitff3700171316bb59e571e1b8604efba191bdb1c0 (patch)
tree4ae37d96a7c92bce380756264d31b82f7420d4af
parent357bc27904d4a99c83d4b01272c34e0e54934fa5 (diff)
downloadrust-ff3700171316bb59e571e1b8604efba191bdb1c0.tar.gz
rust-ff3700171316bb59e571e1b8604efba191bdb1c0.zip
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.rs3
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))];