Skip to content

Omit the vendor component in the WASI triple #60585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
# linked binaries
#musl-root = "..."

# The root location of the `wasm32-unknown-wasi` sysroot.
# The root location of the `wasm32-wasi` sysroot.
#wasi-root = "..."

# Used in testing for configuring where the QEMU images are located, you
Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/dist-various-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ENV TARGETS=x86_64-fuchsia
ENV TARGETS=$TARGETS,aarch64-fuchsia
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
ENV TARGETS=$TARGETS,wasm32-unknown-wasi
ENV TARGETS=$TARGETS,wasm32-wasi
ENV TARGETS=$TARGETS,x86_64-sun-solaris
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi
Expand All @@ -79,5 +79,5 @@ ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda
ENV X86_FORTANIX_SGX_LIBS="/x86_64-fortanix-unknown-sgx/lib/"

ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \
--set target.wasm32-unknown-wasi.wasi-root=/wasm32-unknown-wasi
--set target.wasm32-wasi.wasi-root=/wasm32-wasi
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-various-2/build-wasi-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ git clone https://github.com/CraneStation/wasi-sysroot

cd wasi-sysroot
git reset --hard e5f14be38362f1ab83302895a6e74b2ffd0e2302
make -j$(nproc) INSTALL_DIR=/wasm32-unknown-wasi install
make -j$(nproc) INSTALL_DIR=/wasm32-wasi install

cd ..
rm -rf reference-sysroot-wasi
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ supported_targets! {
("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
("wasm32-unknown-unknown", wasm32_unknown_unknown),
("wasm32-unknown-wasi", wasm32_unknown_wasi),
("wasm32-wasi", wasm32_wasi),
("wasm32-experimental-emscripten", wasm32_experimental_emscripten),

("thumbv6m-none-eabi", thumbv6m_none_eabi),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The `wasm32-unknown-wasi` target is a new and still (as of March 2019)
//! The `wasm32-wasi` target is a new and still (as of April 2019) an
//! experimental target. The definition in this file is likely to be tweaked
//! over time and shouldn't be relied on too much.
//!
Expand All @@ -13,14 +13,14 @@
//! serve two use cases here with this target:
//!
//! * First, we want Rust usage of the target to be as hassle-free as possible,
//! ideally avoiding the need to configure and install a local
//! wasm32-unknown-wasi toolchain.
//! ideally avoiding the need to configure and install a local wasm32-wasi
//! toolchain.
//!
//! * Second, one of the primary use cases of LLVM's new wasm backend and the
//! wasm support in LLD is that any compiled language can interoperate with
//! any other. To that the `wasm32-unknown-wasi` target is the first with a
//! viable C standard library and sysroot common definition, so we want Rust
//! and C/C++ code to interoperate when compiled to `wasm32-unknown-unknown`.
//! any other. To that the `wasm32-wasi` target is the first with a viable C
//! standard library and sysroot common definition, so we want Rust and C/C++
//! code to interoperate when compiled to `wasm32-unknown-unknown`.
//!
//! You'll note, however, that the two goals above are somewhat at odds with one
//! another. To attempt to solve both use cases in one go we define a target
Expand All @@ -39,8 +39,8 @@
//! necessary.
//!
//! All in all, by default, no external dependencies are required. You can
//! compile `wasm32-unknown-wasi` binaries straight out of the box. You can't,
//! however, reliably interoperate with C code in this mode (yet).
//! compile `wasm32-wasi` binaries straight out of the box. You can't, however,
//! reliably interoperate with C code in this mode (yet).
//!
//! ## Interop with C required
//!
Expand All @@ -53,17 +53,17 @@
//!
//! 2. If you're using rustc to build a linked artifact then you'll need to
//! specify `-C linker` to a `clang` binary that supports
//! `wasm32-unknown-wasi` and is configured with the `wasm32-unknown-wasi`
//! sysroot. This will cause Rust code to be linked against the libc.a that
//! the specified `clang` provides.
//! `wasm32-wasi` and is configured with the `wasm32-wasi` sysroot. This
//! will cause Rust code to be linked against the libc.a that the specified
//! `clang` provides.
//!
//! 3. If you're building a staticlib and integrating Rust code elsewhere, then
//! compiling with `-C target-feature=-crt-static` is all you need to do.
//!
//! You can configure the linker via Cargo using the
//! `CARGO_TARGET_WASM32_UNKNOWN_WASI_LINKER` env var. Be sure to also set
//! `CC_wasm32-unknown-wasi` if any crates in the dependency graph are using
//! the `cc` crate.
//! `CARGO_TARGET_WASM32_WASI_LINKER` env var. Be sure to also set
//! `CC_wasm32-wasi` if any crates in the dependency graph are using the `cc`
//! crate.
//!
//! ## Remember, this is all in flux
//!
Expand All @@ -82,7 +82,7 @@ pub fn target() -> Result<Target, String> {
.pre_link_args
.entry(LinkerFlavor::Gcc)
.or_insert(Vec::new())
.push("--target=wasm32-unknown-wasi".to_string());
.push("--target=wasm32-wasi".to_string());

// When generating an executable be sure to put the startup object at the
// front so the main function is correctly hooked up.
Expand All @@ -98,13 +98,13 @@ pub fn target() -> Result<Target, String> {
options.crt_static_respected = true;

Ok(Target {
llvm_target: "wasm32-unknown-wasi".to_string(),
llvm_target: "wasm32-wasi".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
target_os: "wasi".to_string(),
target_env: String::new(),
target_vendor: "unknown".to_string(),
target_vendor: String::new(),
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
arch: "wasm32".to_string(),
linker_flavor: LinkerFlavor::Lld(LldFlavor::Wasm),
Expand Down
2 changes: 1 addition & 1 deletion src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static TARGETS: &[&str] = &[
"thumbv8m.main-none-eabihf",
"wasm32-unknown-emscripten",
"wasm32-unknown-unknown",
"wasm32-unknown-wasi",
"wasm32-wasi",
"x86_64-apple-darwin",
"x86_64-apple-ios",
"x86_64-fortanix-unknown-sgx",
Expand Down