Add a compile command to Wasmtime.

This commit adds a `compile` command to the Wasmtime CLI.

The command can be used to Ahead-Of-Time (AOT) compile WebAssembly modules.

With the `all-arch` feature enabled, AOT compilation can be performed for
non-native architectures (i.e. cross-compilation).

The `Module::compile` method has been added to perform AOT compilation.

A few of the CLI flags relating to "on by default" Wasm features have been
changed to be "--disable-XYZ" flags.

A simple example of using the `wasmtime compile` command:

```text
$ wasmtime compile input.wasm
$ wasmtime input.cwasm
```
This commit is contained in:
Peter Huene
2021-03-24 18:49:33 -07:00
parent 90aa5cf49f
commit 29d366db7b
35 changed files with 1618 additions and 278 deletions

View File

@@ -2,6 +2,35 @@
--------------------------------------------------------------------------------
## Unreleased
### Added
* The `wasmtime compile` command was added to support AOT compilation of Wasm
modules.
* The `Module::compile` method was added to support AOT compilation of a module.
* Added the `Config::cranelift_flag_enable` to enable setting Cranelift boolean
flags or presets in a config.
### Changed
* Breaking: the CLI option `--cranelift-flags` was changed to `--cranelift-flag`.
* Breaking: the CLI option `--enable-reference-types=false` has been changed to
`--disable-reference-types` as it is enabled by default.
* Breaking: the CLI option `--enable-multi-value=false` has been changed to
`--disable-multi-value` as it is enabled by default.
* Breaking: the CLI option `--enable-bulk-memory=false` has been changed to
`--disable-bulk-memory` as it is enabled by default.
* Modules serialized with `Module::serialize` can now be deserialized with
`Module::deserialize` on a compatible host that does not have to match the
original environment exactly.
## 0.25.0
Released 2021-03-16.
@@ -39,7 +68,7 @@ Released 2021-03-16.
### Fixed
* Interepretation of timestamps in `poll_oneoff` for WASI have been fixed to
* Interpretation of timestamps in `poll_oneoff` for WASI have been fixed to
correctly use nanoseconds instead of microseconds.
[#2717](https://github.com/bytecodealliance/wasmtime/pull/2717)