Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Aug 2, 2024
1 parent a5082ef commit 06197ef
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/doc/rustc/src/platform-support/wasm32-unknown-unknown.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Rust standard library additionally must be recompiled.
Compiling all code for the initial release of WebAssembly looks like:

```sh
$ export RUSTFLAG=-Ctarget-cpu=mvp
$ export RUSTFLAGS=-Ctarget-cpu=mvp
$ cargo +nightly build -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown
```

Expand All @@ -166,7 +166,7 @@ about the supported WebAssembly features the engine has.

Note that it is still possible for Rust crates and libraries to enable
WebAssembly features on a per-function level. This means that the build
command above may not be sufficent to disable all WebAssembly features. If the
command above may not be sufficient to disable all WebAssembly features. If the
final binary still has SIMD instructions, for example, the function in question
will need to be found and the crate in question will likely contain something
like:
Expand Down
14 changes: 14 additions & 0 deletions src/doc/rustc/src/platform-support/wasm32-wasip1-threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,17 @@ It's recommended to conditionally compile code for this target with:
Prior to Rust 1.80 the `target_env = "p1"` key was not set. Currently the
`target_feature = "atomics"` is Nightly-only. Note that the precise `#[cfg]`
necessary to detect this target may change as the target becomes more stable.

## Enabled WebAssembly features

The default set of WebAssembly features enabled for compilation is similar to
[`wasm32-unknown-unknokwn`](./wasm32-unknown-unknown.md) but two more features
are included:

* `bulk-memory`
* `atomics`

For more information about features see the documentation for
[`wasm32-unknown-unknokwn`](./wasm32-unknown-unknown.md), but note that the
`mvp` CPU in LLVM does not support this target as it's required that
`bulk-memory`, `atomics`, and `mutable-globals` are all enabled.
5 changes: 2 additions & 3 deletions src/doc/rustc/src/platform-support/wasm32-wasip1.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,5 @@ to Rust 1.80 the `target_env` condition was not set.
## Enabled WebAssembly features

The default set of WebAssembly features enabled for compilation is currently the
same across all WebAssembly targets. For more information on WebAssembly
features see the documentation for
[`wasm32-unknown-unknokwn`](./wasm32-unknown-unknown.md)
same as [`wasm32-unknown-unknokwn`](./wasm32-unknown-unknown.md). See the
documentation there for more information.
5 changes: 2 additions & 3 deletions src/doc/rustc/src/platform-support/wasm32-wasip2.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,5 @@ It's recommended to conditionally compile code for this target with:
## Enabled WebAssembly features

The default set of WebAssembly features enabled for compilation is currently the
same across all WebAssembly targets. For more information on WebAssembly
features see the documentation for
[`wasm32-unknown-unknokwn`](./wasm32-unknown-unknown.md)
same as [`wasm32-unknown-unknokwn`](./wasm32-unknown-unknown.md). See the
documentation there for more information.

0 comments on commit 06197ef

Please sign in to comment.