Rollup merge of #126967 - alexcrichton:wasm32-wasip2-tier-2, r=Mark-Simulacrum
Promote the `wasm32-wasip2` target to Tier 2 This commit promotes the `wasm32-wasip2` Rust target to tier 2 as proposed in rust-lang/compiler-team#760. There are two major changes in this PR: 1. The `dist-various-2` container, which already produces the other WASI targets, now has an extra target added for `wasm32-wasip2`. 2. A new `wasm-component-ld` binary is added to all host toolchains when LLD is enabled. This is the linker used for the `wasm32-wasip2` target. This new linker is added for all host toolchains to ensure that all host toolchains can produce the `wasm32-wasip2` target. This is similar to how `rust-lld` was originally included for all host toolchains to be able to produce WebAssembly output when the targets were first added. The new linker is developed [here][wasm-component-ld] and is pulled in via a crates.io-based dependency to the tree here. [wasm-component-ld]: https://github.com/bytecodealliance/wasm-component-ld
This commit is contained in:
commit
4e4fa7eb37
9 changed files with 264 additions and 3 deletions
|
|
@ -1820,6 +1820,21 @@ impl Step for Assemble {
|
|||
&self_contained_lld_dir.join(exe(name, target_compiler.host)),
|
||||
);
|
||||
}
|
||||
|
||||
// In addition to `rust-lld` also install `wasm-component-ld` when
|
||||
// LLD is enabled. This is a relatively small binary that primarily
|
||||
// delegates to the `rust-lld` binary for linking and then runs
|
||||
// logic to create the final binary. This is used by the
|
||||
// `wasm32-wasip2` target of Rust.
|
||||
let wasm_component_ld_exe =
|
||||
builder.ensure(crate::core::build_steps::tool::WasmComponentLd {
|
||||
compiler: build_compiler,
|
||||
target: target_compiler.host,
|
||||
});
|
||||
builder.copy_link(
|
||||
&wasm_component_ld_exe,
|
||||
&libdir_bin.join(wasm_component_ld_exe.file_name().unwrap()),
|
||||
);
|
||||
}
|
||||
|
||||
if builder.config.llvm_enabled(target_compiler.host) {
|
||||
|
|
|
|||
|
|
@ -337,6 +337,7 @@ bootstrap_tool!(
|
|||
RustdocGUITest, "src/tools/rustdoc-gui-test", "rustdoc-gui-test", is_unstable_tool = true, allow_features = "test";
|
||||
CoverageDump, "src/tools/coverage-dump", "coverage-dump";
|
||||
RustcPerfWrapper, "src/tools/rustc-perf-wrapper", "rustc-perf-wrapper";
|
||||
WasmComponentLd, "src/tools/wasm-component-ld", "wasm-component-ld", is_unstable_tool = true, allow_features = "min_specialization";
|
||||
);
|
||||
|
||||
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue