Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

fix missing unwind feature cfg in pulley (#15115)

Firestar998c11e2e0edbd
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 21667cf1b3..c3ec9bdd83 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -423,7 +423,8 @@ jobs:
- name: cranelift-codegen
checks: |
-p cranelift-codegen --benches
- -p cranelift-codegen --no-default-features --features std,unwind,pulley
+ -p cranelift-codegen --no-default-features --features std,unwind,all-arch
+ -p cranelift-codegen --no-default-features --features std,all-arch
- name: cranelift-entity
checks: |
diff --git a/.gitignore b/.gitignore
index 8c52fc2113..5a14541758 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ report/
cranelift/isle/veri/cache/
# Staging directory used by `verify.sh rebuild-cache` before it swaps in.
cranelift/isle/veri/cache.rebuild/
+.idea/
diff --git a/cranelift/codegen/src/isa/pulley_shared/mod.rs b/cranelift/codegen/src/isa/pulley_shared/mod.rs
index 2140bcb562..4350d0d183 100644
--- a/cranelift/codegen/src/isa/pulley_shared/mod.rs
+++ b/cranelift/codegen/src/isa/pulley_shared/mod.rs
@@ -11,7 +11,7 @@ use crate::{
MachTextSectionBuilder, TextSectionBuilder,
dominator_tree::DominatorTree,
ir,
- isa::{self, IsaFlagsHashKey, OwnedTargetIsa, TargetIsa},
+ isa::{IsaFlagsHashKey, OwnedTargetIsa, TargetIsa},
machinst::{self, CompiledCode, CompiledCodeStencil, MachInst, SigSet, VCode},
result::CodegenResult,
settings::{self as shared_settings, Flags},
@@ -207,11 +207,12 @@ where
}))
}
+ #[cfg(feature = "unwind")]
fn emit_unwind_info(
&self,
- _result: &crate::CompiledCode,
+ _result: &CompiledCode,
_kind: super::unwind::UnwindInfoKind,
- ) -> CodegenResult<Option<isa::unwind::UnwindInfo>> {
+ ) -> CodegenResult<Option<super::unwind::UnwindInfo>> {
// TODO: actually support unwind info?
Ok(None)
}
diff --git a/cranelift/codegen/src/isa/unwind.rs b/cranelift/codegen/src/isa/unwind.rs
index c9ea050fb2..4526bdf676 100644
--- a/cranelift/codegen/src/isa/unwind.rs
+++ b/cranelift/codegen/src/isa/unwind.rs
@@ -214,11 +214,13 @@ pub enum UnwindInst {
},
}
+#[cfg(feature = "unwind")]
struct Writer<'a> {
buf: &'a mut [u8],
offset: usize,
}
+#[cfg(feature = "unwind")]
impl<'a> Writer<'a> {
pub fn new(buf: &'a mut [u8]) -> Self {
Self { buf, offset: 0 }