From 4750e9de4790672481f6709af015efd17dbf18f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 7 Dec 2023 12:34:54 +0100 Subject: [PATCH] Produce an explicit error when using a self-contained lld, but we don't add it to sysroot --- src/bootstrap/src/core/config/config.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index ade7d83f8b2d2..105b7d74dfc1e 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1519,6 +1519,16 @@ impl Config { } set(&mut config.lld_mode, rust.lld_mode); set(&mut config.lld_enabled, rust.lld); + + if matches!(config.lld_mode, LldMode::SelfContained) + && !config.lld_enabled + && flags.stage.unwrap_or(0) > 0 + { + panic!( + "Trying to use self-contained lld as a linker, but LLD is not being added to the sysroot. Enable it with rust.lld = true." + ); + } + set(&mut config.llvm_tools_enabled, rust.llvm_tools); config.rustc_parallel = rust .parallel_compiler