Add a wasmtime settings command to print Cranelift settings.

This commit adds the `wasmtime settings` command to print out available
Cranelift settings for a target (defaults to the host).

The compile command has been updated to remove the Cranelift ISA options in
favor of encouraging users to use `wasmtime settings` to discover what settings
are available.  This will reduce the maintenance cost for syncing the compile
command with Cranelift ISA flags.
This commit is contained in:
Peter Huene
2021-03-31 22:44:13 -07:00
parent a474524d3b
commit abf3bf29f9
16 changed files with 478 additions and 312 deletions

View File

@@ -11,7 +11,7 @@ pub mod ir {
pub mod settings {
pub use cranelift_codegen::settings::{
builder, Builder, Configurable, Flags, OptLevel, SetError,
builder, Builder, Configurable, Flags, OptLevel, SetError, Setting, SettingKind,
};
}

View File

@@ -271,6 +271,15 @@ impl Module {
return Self::deserialize(engine, &binary[COMPILED_MODULE_HEADER.len()..]);
}
// Check to see that the config's target matches the host
let target = engine.config().isa_flags.triple();
if *target != target_lexicon::Triple::host() {
bail!(
"target '{}' specified in the configuration does not match the host",
target
);
}
const USE_PAGED_MEM_INIT: bool = cfg!(all(feature = "uffd", target_os = "linux"));
cfg_if::cfg_if! {