Skip to content

Commit

Permalink
Don't infer host flags for cross-compiled targets (#7991)
Browse files Browse the repository at this point in the history
This commit fixes an accidental regression from #7766 where
`infer_native_flags` is called even if a target is explicitly specified
to a `Config`. Now inference only happens if a target isn't specified
meaning that the host is selected.
  • Loading branch information
alexcrichton authored Feb 23, 2024
1 parent 0e8c868 commit 0724fe2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/cranelift-shared/src/isa_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ impl<T> IsaBuilder<T> {
.set("enable_probestack", "false")
.expect("should be valid flag");

let triple_specified = triple.is_some();
let triple = triple.unwrap_or_else(Triple::host);
let mut isa_flags = lookup(triple)?;
cranelift_native::infer_native_flags(&mut isa_flags).unwrap();
if !triple_specified {
cranelift_native::infer_native_flags(&mut isa_flags).unwrap();
}

Ok(Self {
shared_flags: flags,
Expand Down

0 comments on commit 0724fe2

Please sign in to comment.