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
2
2
//! experimental target. The definition in this file is likely to be tweaked
3
3
//! over time and shouldn't be relied on too much.
4
4
//!
13
13
//! serve two use cases here with this target:
14
14
//!
15
15
//! * 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.
18
18
//!
19
19
//! * Second, one of the primary use cases of LLVM's new wasm backend and the
20
20
//! 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`.
24
24
//!
25
25
//! You'll note, however, that the two goals above are somewhat at odds with one
26
26
//! another. To attempt to solve both use cases in one go we define a target
39
39
//! necessary.
40
40
//!
41
41
//! 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).
44
44
//!
45
45
//! ## Interop with C required
46
46
//!
53
53
//!
54
54
//! 2. If you're using rustc to build a linked artifact then you'll need to
55
55
//! 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.
59
59
//!
60
60
//! 3. If you're building a staticlib and integrating Rust code elsewhere, then
61
61
//! compiling with `-C target-feature=-crt-static` is all you need to do.
62
62
//!
63
63
//! 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.
67
67
//!
68
68
//! ## Remember, this is all in flux
69
69
//!
@@ -82,7 +82,7 @@ pub fn target() -> Result<Target, String> {
82
82
. pre_link_args
83
83
. entry ( LinkerFlavor :: Gcc )
84
84
. or_insert ( Vec :: new ( ) )
85
- . push ( "--target=wasm32-unknown- wasi" . to_string ( ) ) ;
85
+ . push ( "--target=wasm32-wasi" . to_string ( ) ) ;
86
86
87
87
// When generating an executable be sure to put the startup object at the
88
88
// front so the main function is correctly hooked up.
@@ -98,13 +98,13 @@ pub fn target() -> Result<Target, String> {
98
98
options. crt_static_respected = true ;
99
99
100
100
Ok ( Target {
101
- llvm_target : "wasm32-unknown- wasi" . to_string ( ) ,
101
+ llvm_target : "wasm32-wasi" . to_string ( ) ,
102
102
target_endian : "little" . to_string ( ) ,
103
103
target_pointer_width : "32" . to_string ( ) ,
104
104
target_c_int_width : "32" . to_string ( ) ,
105
105
target_os : "wasi" . to_string ( ) ,
106
106
target_env : String :: new ( ) ,
107
- target_vendor : "unknown" . to_string ( ) ,
107
+ target_vendor : String :: new ( ) ,
108
108
data_layout : "e-m:e-p:32:32-i64:64-n32:64-S128" . to_string ( ) ,
109
109
arch : "wasm32" . to_string ( ) ,
110
110
linker_flavor : LinkerFlavor :: Lld ( LldFlavor :: Wasm ) ,
0 commit comments