This commit is contained in:
bjorn3 2025-03-12 13:02:12 +00:00
commit 11565c3471
3 changed files with 25 additions and 28 deletions

View file

@ -175,13 +175,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
}
}
fn target_features_cfg(
&self,
sess: &Session,
_allow_unstable: bool,
) -> Vec<rustc_span::Symbol> {
fn target_features_cfg(&self, sess: &Session) -> (Vec<Symbol>, Vec<Symbol>) {
// FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
if sess.target.arch == "x86_64" && sess.target.os != "none" {
let target_features = if sess.target.arch == "x86_64" && sess.target.os != "none" {
// x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
vec![sym::fsxr, sym::sse, sym::sse2, Symbol::intern("x87")]
} else if sess.target.arch == "aarch64" {
@ -195,7 +191,10 @@ impl CodegenBackend for CraneliftCodegenBackend {
}
} else {
vec![]
}
};
// FIXME do `unstable_target_features` properly
let unstable_target_features = target_features.clone();
(target_features, unstable_target_features)
}
fn print_version(&self) {