1# Platform Support 2 3This page is intended to give a high-level overview of Wasmtime's platform 4support along with some aspirations of Wasmtime. For more details see the 5documentation on [tiers of stability](./stability-tiers.md) which has specific 6information about what's supported in Wasmtime on a per-matrix-combination 7basis. 8 9Wasmtime strives to support hardware that anyone wants to run WebAssembly on. 10Maintainers of Wasmtime support a number of "major" platforms themselves but 11porting work may be required to support platforms that maintainers are not 12themselves familiar with. Out-of-the box Wasmtime supports: 13 14* Linux x86\_64, aarch64, s390x, and riscv64 15* macOS x86\_64, aarch64 16* Windows x86\_64 17 18Other platforms such as Android, iOS, and the BSD family of OSes are not 19built-in yet. PRs for porting are welcome and maintainers are happy to add more 20entries to the CI matrix for these platforms. 21 22## Compiler Support 23 24Cranelift supports x86\_64, aarch64, s390x, and riscv64. No 32-bit platform is 25currently supported. Building a new backend for Cranelift is a relatively large 26undertaking which maintainers are willing to help with but it's recommended to 27reach out to Cranelift maintainers first to discuss this. 28 29Winch supports x86\_64. The aarch64 backend is in development. Winch is built on 30Cranelift's support for emitting instructions so Winch's possible backend list 31is currently limited to what Cranelift supports. 32 33Usage of the Cranelift or Winch requires a host operating system which supports 34creating executable memory pages on-the-fly. Support for statically linking in a 35single precompiled module is not supported at this time. 36 37Both Cranelift and Winch can be used either in AOT or JIT mode. In AOT mode one 38process precompiles a module/component and then loads it into another process. 39In JIT mode this is all done within the same process. 40 41Neither Cranelift nor Winch support tiering at this time in the sense of having 42a WebAssembly module start from a Winch compilation and automatically switch to 43a Cranelift compilation. Modules are either entirely compiled with Winch or 44Cranelift. 45 46## Interpreter support 47 48At this time `wasmtime` does not have a mode in which it simply interprets 49WebAssembly code. It is desired to add support for an interpreter, however, and 50this will have minimal system dependencies. It is planned that the system will 51need to support some form of dynamic memory allocation, but other than that not 52much else will be needed. 53 54## Support for `#![no_std]` 55 56The `wasmtime` crate supports being build on no\_std platforms in Rust, but 57only for a subset of its compile-time Cargo features. Currently supported 58Cargo features are: 59 60* `runtime` 61* `gc` 62* `component-model` 63 64This notably does not include the `default` feature which means that when 65depending on Wasmtime you'll need to specify `default-features = false`. This 66also notably does not include Cranelift or Winch at this time meaning that 67no\_std platforms must be used in AOT mode where the module is precompiled 68elsewhere. 69 70Wasmtime's support for no\_std requires the embedder to implement the equivalent 71of a C header file to indicate how to perform basic OS operations such as 72allocating virtual memory. This API can be found as `wasmtime-platform.h` in 73Wasmtime's release artifacts or at 74`examples/min-platform/embedding/wasmtime-platform.h` in the source tree. Note 75that this API is not guaranteed to be stable at this time, it'll need to be 76updated when Wasmtime is updated. 77 78Wasmtime's runtime will use the symbols defined in this file meaning that if 79they're not defined then a link-time error will be generated. Embedders are 80required to implement these functions in accordance with their documentation to 81enable Wasmtime to run on custom platforms. 82