Add target_feature = "gc" for Wasm

This commit is contained in:
daxpedda 2025-12-19 20:17:46 +01:00
parent b889870082
commit 4ee01c4e4c
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F
3 changed files with 6 additions and 0 deletions

View file

@ -266,6 +266,10 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
"leoncasa" => Some(LLVMFeature::new("hasleoncasa")),
s => Some(LLVMFeature::new(s)),
},
Arch::Wasm32 | Arch::Wasm64 => match s {
"gc" if major < 22 => None,
s => Some(LLVMFeature::new(s)),
},
Arch::X86 | Arch::X86_64 => {
match s {
"sse4.2" => Some(LLVMFeature::with_dependencies(

View file

@ -745,6 +745,7 @@ static WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("bulk-memory", Stable, &[]),
("exception-handling", Unstable(sym::wasm_target_feature), &[]),
("extended-const", Stable, &[]),
("gc", Unstable(sym::wasm_target_feature), &["reference-types"]),
("multivalue", Stable, &[]),
("mutable-globals", Stable, &[]),
("nontrapping-fptoint", Stable, &[]),

View file

@ -121,6 +121,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
`frecipe`
`frintts`
`fxsr`
`gc`
`gfni`
`guarded-storage`
`hard-float`