Wasmtime+Cranelift: strip out some dead x86-32 code. (#5226)

* Wasmtime+Cranelift: strip out some dead x86-32 code.

I was recently pointed to fastly/Viceroy#200 where it seems some folks
are trying to compile Wasmtime (via Viceroy) for Windows x86-32 and the
failures may not be loud enough. I've tried to reproduce this
cross-compiling to i686-pc-windows-gnu from Linux and hit build failures
(as expected) in several places.  Nevertheless, while trying to discern
what others may be attempting, I noticed some dead x86-32-specific code
in our repo, and figured it would be a good idea to clean this up.
Otherwise, it (i) sends some mixed messages -- "hey look, this codebase
does support x86-32" -- and (ii) keeps untested code around, which is
generally not great.

This PR removes x86-32-specific cases in traphandlers and unwind code,
and Cranelift's native feature detection. It adds helpful compile-error
messages in a few cases. If we ever support x86-32 (contributors
welcome! The big missing piece is Cranelift support; see #1980), these
compile errors and git history should be enough to recover any knowledge
we are now encoding in the source.

I left the x86-32 support in `wasmtime-fiber` alone because that seems
like a bit of a special case -- foundation library, separate from the
rest of Wasmtime, with specific care to provide a (presumably working)
full 32-bit version.

* Remove some extraneous compile_error!s, already covered by others.
This commit is contained in:
Chris Fallin
2022-11-08 15:03:17 -08:00
committed by GitHub
parent fd7b903f33
commit d59caf39b6
6 changed files with 12 additions and 43 deletions

View File

@@ -2,9 +2,6 @@ cfg_if::cfg_if! {
if #[cfg(all(windows, any(target_arch = "x86_64", target_arch = "aarch64")))] {
mod winx64;
pub use self::winx64::*;
} else if #[cfg(all(windows, target_arch = "x86"))] {
mod winx32;
pub use self::winx32::*;
} else if #[cfg(unix)] {
mod systemv;
pub use self::systemv::*;

View File

@@ -1,20 +0,0 @@
//! Stub unwind registry for Windows x32.
use anyhow::{bail, Result};
use cranelift_codegen::isa::{unwind::UnwindInfo, TargetIsa};
pub struct UnwindRegistry {}
impl UnwindRegistry {
pub fn new(_base_address: usize) -> Self {
Self {}
}
pub fn register(&mut self, _func_start: u32, _func_len: u32, _info: &UnwindInfo) -> Result<()> {
bail!("winx32 has no unwind registry")
}
pub fn publish(&mut self, _isa: &dyn TargetIsa) -> Result<()> {
Ok(())
}
}