-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for completely unknown architectures #10107
Improve support for completely unknown architectures #10107
Conversation
This commit is a step in the direction of trying to make Wasmtime more portable by default. The goal here is to enable Wasmtime to compile for architectures that it has no prior knowledge of. There's a few miscellaneous locations through Wasmtime where we need architecture-specific intrinsics and such but that's all in service of Cranelift itself. Without Cranelift support none of them are necessary. This commit plumbs a custom `#[cfg]` from Wasmtime's `build.rs` script into the crate about whether there's a supported Cranelift backend. If this isn't available some architecture-specific intrinsics are turned off and not included. An example is that `vm::arch` entirely disappears which is only in service of `UnwindHost`, which also disappears. Furthermore the `helpers.c` file also entirely disappears as it's not necessary on unknown architectures. To help keep this working I've added CI to build Wasmtime for `powerpc64le-unknown-linux-gnu`. Wasmtime currently has no support for this architecture, although if it grows such support in the future this'll need to be changed to some other unsupported architecture.
crates/wasmtime/src/runtime/func.rs
Outdated
// When Cranelift has support for the host then we might be running native | ||
// compiled code meaning we need to read the actual stack pointer. If | ||
// Cranelift can't be used though then we're guaranteed to be running pulley | ||
// in which case this stack poitner isn't actually used as Pulley has custom | ||
// mechanisms for stack overflow. | ||
#[cfg(has_cranelift_host_backend)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this has_host_compiler_backend
? While we don't have any target supported on Winch but not Cranelift now, it doesn't seem like it would be impossible in the future, so we should just try to be a little more precise about what we are saying.
Shuffle some files around to be more amenable to #[cfg]
That way it's got easy access to the #[cfg]'s from the build script
Even if custom signals are enabled, don't compile it in. prtest:full
These aren't needed any more to compile Pulley
Instead of validating at `Engine` config time instead validate at `Module` config time to enable cross-compilation.
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
To modify this label's message, edit the To add new label messages or remove existing label messages, edit the |
Ensures that specific `--target pulleyNN` works most of the time.
No signal handlers are used at all with Pulley so when the async stack overflows there's no message printed any more.
I probably should have done
Juggling compile options I feel still isn't great. Ideally everything "just works" but it's a narrow needle to thread trying to juggle different crate features and targetting different environments. Ideally we'd be able to query |
This commit is a step in the direction of trying to make Wasmtime more portable by default. The goal here is to enable Wasmtime to compile for architectures that it has no prior knowledge of. There's a few miscellaneous locations through Wasmtime where we need architecture-specific intrinsics and such but that's all in service of Cranelift itself. Without Cranelift support none of them are necessary.
This commit plumbs a custom
#[cfg]
from Wasmtime'sbuild.rs
script into the crate about whether there's a supported Cranelift backend. If this isn't available some architecture-specific intrinsics are turned off and not included. An example is thatvm::arch
entirely disappears which is only in service ofUnwindHost
, which also disappears. Furthermore thehelpers.c
file also entirely disappears as it's not necessary on unknown architectures.To help keep this working I've added CI to build Wasmtime for
powerpc64le-unknown-linux-gnu
. Wasmtime currently has no support for this architecture, although if it grows such support in the future this'll need to be changed to some other unsupported architecture.