Skip to content

Wasm hardware support (including 32-bit like Windows i686 and Linux armhf) #757

@illwieckz

Description

@illwieckz

This is a parent thread to follow outside work on Wasm as we investigate a migration from Native Client (NaCl) to WebAssembly (Wasm).

Platform support:

platform dæmon naclsdk nacl wasisdk wasmtime wamr wasmtime request
amd64 ✅ yes ✅ yes ✅ yes ✅ yes ✅ yes ✅ yes
i686 ✅ yes ✅ yes ✅ yes ? no ✅ yes bytecodealliance/wasmtime#1980
arm64 ✅ yes no no ? ✅ yes ✅ yes
armhf ✅ yes no ✅ yes ? no ✅ yes bytecodealliance/wasmtime#1173
riscv64 ? no no ? ✅ yes ✅ yes
ppc64el ? no no ? no no bytecodealliance/wasmtime#1183

Note: the NaCl vm also supports mips (not the naclsdk) and wasmtime supports s390x but we probably have no usage for that.

See this wasmtime label for new targets being discussed:

We may also investigate the WebAssembly micro runtime (WAMR), WAMR runs on amd64, i686, arm64, armhf, riscv64 architectures at least, and on Linux, Windows, macOS, and Android systems at least.


This first post focus on 32-bit (what motivated this thread), but other architectures can be discussed.

As WebAssembly is the candidate of choice to replace NaCl, it is interesting to look at what platform it supports. Tracking this is low priority but it's not a bad idea to gather the related knowledge and have a place to track this in a dedicated place.

The NaCl stack we currently use to run the sandboxed game code provides ability to build and run 64-bit amd64 and 32-bit i686, armhf and mips binaries (I doubt there is a single compatible mips platform though). There may be a 64-bit arm64 support in NaCl repository, but a build for it haven't been found yet. So, from that we have working amd64, i386 and armhf.

The Wasmtime runtime provides support for 64-bit amd64, arm64, riscv64 and s390x (I doubt we would have a single s390x user though, and it's too early for riscv64). There is no supported 32-bit platform at all. So from that we may hope to get working amd64 and arm64.

Among existing 32-bit platform around, the major interests are in:

  • Windows i686, Windows users who got a 32-bit Windows typically don't replace it with a 64-bit Windows. A lot of computers pre-installed with 32-bit Windows were sold very lately, even if running on 64-bit compatible hardware.
  • Linux armhf, usage of 32-bit armhf Linux distributions is very common arm64 boards. For example the default and recommended operating system download for the well-known raspberry pi is 32-bit, even if the CPU is compatible 64-bit and there are 64-bit operating system alternate download available. Some proprietary drivers for some GPUs commonly found on arm64 boards may even be 32-bit only.

As @necessarily-equal wrote in Unvanquished/Unvanquished#1015

https://docs.wasmtime.dev/stability-platform-support.html#jit-compiler-support they seem to say 32 bits support is "planned". The compilation error that you have seen was apparently introduced by bytecodealliance/wasmtime#5226 or a similar PR. It seems the hard part of doing this isn't in wasmtime, but in cranelift.

Adding 32 bits support would be tracked in bytecodealliance/wasmtime#1980 for wasmtime, but no one seems to be working on it at the moment. I honestly doubt someone will feel motivated enough to add support for that, so I'd rather plan the "no 32 bit support" case than the other way around.

Here is the wasmtime ticket to track 32-bit arm support: bytecodealliance/wasmtime#1173
They're welcoming any 32-bit arm implementation but had to remove an half-implemented one because it was unmaintained: bytecodealliance/wasmtime#3721

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions