1- //! The `wasm32-unknown- wasi` target is a new and still (as of March 2019)
1+ //! The `wasm32-wasi` target is a new and still (as of April 2019) an
22//! experimental target. The definition in this file is likely to be tweaked
33//! over time and shouldn't be relied on too much.
44//!
1313//! serve two use cases here with this target:
1414//!
1515//! * First, we want Rust usage of the target to be as hassle-free as possible,
16- //! ideally avoiding the need to configure and install a local
17- //! wasm32-unknown-wasi toolchain.
16+ //! ideally avoiding the need to configure and install a local wasm32-wasi
17+ //! toolchain.
1818//!
1919//! * Second, one of the primary use cases of LLVM's new wasm backend and the
2020//! wasm support in LLD is that any compiled language can interoperate with
21- //! any other. To that the `wasm32-unknown- wasi` target is the first with a
22- //! viable C standard library and sysroot common definition, so we want Rust
23- //! and C/C++ code to interoperate when compiled to `wasm32-unknown-unknown`.
21+ //! any other. To that the `wasm32-wasi` target is the first with a viable C
22+ //! standard library and sysroot common definition, so we want Rust and C/C++
23+ //! code to interoperate when compiled to `wasm32-unknown-unknown`.
2424//!
2525//! You'll note, however, that the two goals above are somewhat at odds with one
2626//! another. To attempt to solve both use cases in one go we define a target
3939//! necessary.
4040//!
4141//! All in all, by default, no external dependencies are required. You can
42- //! compile `wasm32-unknown- wasi` binaries straight out of the box. You can't,
43- //! however, reliably interoperate with C code in this mode (yet).
42+ //! compile `wasm32-wasi` binaries straight out of the box. You can't, however ,
43+ //! reliably interoperate with C code in this mode (yet).
4444//!
4545//! ## Interop with C required
4646//!
5353//!
5454//! 2. If you're using rustc to build a linked artifact then you'll need to
5555//! specify `-C linker` to a `clang` binary that supports
56- //! `wasm32-unknown- wasi` and is configured with the `wasm32-unknown- wasi`
57- //! sysroot. This will cause Rust code to be linked against the libc.a that
58- //! the specified `clang` provides.
56+ //! `wasm32-wasi` and is configured with the `wasm32-wasi` sysroot. This
57+ //! will cause Rust code to be linked against the libc.a that the specified
58+ //! `clang` provides.
5959//!
6060//! 3. If you're building a staticlib and integrating Rust code elsewhere, then
6161//! compiling with `-C target-feature=-crt-static` is all you need to do.
6262//!
6363//! You can configure the linker via Cargo using the
64- //! `CARGO_TARGET_WASM32_UNKNOWN_WASI_LINKER ` env var. Be sure to also set
65- //! `CC_wasm32-unknown- wasi` if any crates in the dependency graph are using
66- //! the `cc` crate.
64+ //! `CARGO_TARGET_WASM32_WASI_LINKER ` env var. Be sure to also set
65+ //! `CC_wasm32-wasi` if any crates in the dependency graph are using the `cc`
66+ //! crate.
6767//!
6868//! ## Remember, this is all in flux
6969//!
@@ -82,7 +82,7 @@ pub fn target() -> Result<Target, String> {
8282 . pre_link_args
8383 . entry ( LinkerFlavor :: Gcc )
8484 . or_insert ( Vec :: new ( ) )
85- . push ( "--target=wasm32-unknown- wasi" . to_string ( ) ) ;
85+ . push ( "--target=wasm32-wasi" . to_string ( ) ) ;
8686
8787 // When generating an executable be sure to put the startup object at the
8888 // front so the main function is correctly hooked up.
@@ -98,13 +98,13 @@ pub fn target() -> Result<Target, String> {
9898 options. crt_static_respected = true ;
9999
100100 Ok ( Target {
101- llvm_target : "wasm32-unknown- wasi" . to_string ( ) ,
101+ llvm_target : "wasm32-wasi" . to_string ( ) ,
102102 target_endian : "little" . to_string ( ) ,
103103 target_pointer_width : "32" . to_string ( ) ,
104104 target_c_int_width : "32" . to_string ( ) ,
105105 target_os : "wasi" . to_string ( ) ,
106106 target_env : String :: new ( ) ,
107- target_vendor : "unknown" . to_string ( ) ,
107+ target_vendor : String :: new ( ) ,
108108 data_layout : "e-m:e-p:32:32-i64:64-n32:64-S128" . to_string ( ) ,
109109 arch : "wasm32" . to_string ( ) ,
110110 linker_flavor : LinkerFlavor :: Lld ( LldFlavor :: Wasm ) ,
0 commit comments