Skip to content

Commit 4fb8eca

Browse files
Don't infer host flags for cross-compiled targets (#7991) (#8100)
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. Co-authored-by: Alex Crichton <alex@alexcrichton.com>
1 parent 90db6e9 commit 4fb8eca

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

RELEASES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
--------------------------------------------------------------------------------
22

3+
## 18.0.3
4+
5+
### Fixed
6+
7+
* Fix inferring native flags when a compilation target is specified.
8+
https://github.com/bytecodealliance/wasmtime/pull/7991
9+
10+
--------------------------------------------------------------------------------
11+
312
## 18.0.2
413

514
Released 2024-02-28.

crates/cranelift-shared/src/isa_builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ impl<T> IsaBuilder<T> {
2828
.set("enable_probestack", "false")
2929
.expect("should be valid flag");
3030

31+
let triple_specified = triple.is_some();
3132
let triple = triple.unwrap_or_else(Triple::host);
3233
let mut isa_flags = lookup(triple)?;
33-
cranelift_native::infer_native_flags(&mut isa_flags).unwrap();
34+
if !triple_specified {
35+
cranelift_native::infer_native_flags(&mut isa_flags).unwrap();
36+
}
3437

3538
Ok(Self {
3639
shared_flags: flags,

0 commit comments

Comments
 (0)