From 9bcdf90f1df87fd679544d986400a02061edbe27 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 27 Aug 2024 09:11:42 -0700 Subject: [PATCH] Fix `cranelift-codegen` build script for Pulley backends (#9172) * Fix `cranelift-codegen` build script for Pulley backends The cargo feature is called "pulley" for both the pulley32 and pulley64 backends, since they are the same code, but the build script was checking for cargo features named "pulley32" and "pulley64" instead. * Fix warnings in build --- .github/workflows/main.yml | 5 +++-- cranelift/codegen/build.rs | 7 ++++++- cranelift/codegen/src/isa/pulley_shared/mod.rs | 2 +- cranelift/codegen/src/machinst/isle.rs | 5 +---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7fef12f506..e494c98e34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -384,9 +384,10 @@ jobs: -p wasmtime-cli --all-features -p wasmtime-cli --features component-model - - name: cranelift-codegen benches + - name: cranelift-codegen checks: | - --benches -p cranelift-codegen + -p cranelift-codegen --benches + -p cranelift-codegen --no-default-features --features std,unwind,pulley - name: wasmtime-bench-api checks: | diff --git a/cranelift/codegen/build.rs b/cranelift/codegen/build.rs index 76ef4e5983..4bfc8ca237 100644 --- a/cranelift/codegen/build.rs +++ b/cranelift/codegen/build.rs @@ -36,7 +36,12 @@ fn main() { .iter() .cloned() .filter(|isa| { - let env_key = format!("CARGO_FEATURE_{}", isa.to_string().to_uppercase()); + let env_key = match isa { + meta::isa::Isa::Pulley32 | meta::isa::Isa::Pulley64 => { + "CARGO_FEATURE_PULLEY".to_string() + } + _ => format!("CARGO_FEATURE_{}", isa.to_string().to_uppercase()), + }; all_arch || env::var(env_key).is_ok() }) .collect::>(); diff --git a/cranelift/codegen/src/isa/pulley_shared/mod.rs b/cranelift/codegen/src/isa/pulley_shared/mod.rs index 50e8c83749..84824de2f7 100644 --- a/cranelift/codegen/src/isa/pulley_shared/mod.rs +++ b/cranelift/codegen/src/isa/pulley_shared/mod.rs @@ -122,7 +122,7 @@ where let emit_info = EmitInfo::new(self.flags.clone(), self.isa_flags.clone()); let sigs = SigSet::new::>(func, &self.flags)?; let abi = abi::PulleyCallee::new(func, self, &self.isa_flags, &sigs)?; - machinst::compile::compile::(func, domtree, self, abi, emit_info, sigs, ctrl_plane) + machinst::compile::(func, domtree, self, abi, emit_info, sigs, ctrl_plane) } } diff --git a/cranelift/codegen/src/machinst/isle.rs b/cranelift/codegen/src/machinst/isle.rs index 3c1388ab12..3d5b2d9611 100644 --- a/cranelift/codegen/src/machinst/isle.rs +++ b/cranelift/codegen/src/machinst/isle.rs @@ -6,10 +6,7 @@ use std::cell::Cell; pub use super::MachLabel; use super::RetPair; -pub use crate::ir::{ - condcodes::CondCode, dynamic_to_fixed, Constant, DynamicStackSlot, ExternalName, FuncRef, - GlobalValue, Immediate, SigRef, StackSlot, -}; +pub use crate::ir::{condcodes::CondCode, *}; pub use crate::isa::{unwind::UnwindInst, TargetIsa}; pub use crate::machinst::{ ABIArg, ABIArgSlot, ABIMachineSpec, CallSite, InputSourceInst, Lower, LowerBackend, RealReg,