diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/compile.rs | 12 | ||||
| -rw-r--r-- | src/bootstrap/src/lib.rs | 13 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index d4dd3e546ec..c3ce66d5e3a 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1820,12 +1820,14 @@ 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. + // 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. + if builder.build_wasm_component_ld() { let wasm_component_ld_exe = builder.ensure(crate::core::build_steps::tool::WasmComponentLd { compiler: build_compiler, diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index a77c20067e6..d2910f8edc6 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1414,6 +1414,19 @@ Executed at: {executed_at}"#, None } + /// Returns whether it's requested that `wasm-component-ld` is built as part + /// of the sysroot. This is done either with the `extended` key in + /// `config.toml` or with the `tools` set. + fn build_wasm_component_ld(&self) -> bool { + if self.config.extended { + return true; + } + match &self.config.tools { + Some(set) => set.contains("wasm-component-ld"), + None => false, + } + } + /// Returns the root of the "rootfs" image that this target will be using, /// if one was configured. /// |
