Produce an explicit error when using a self-contained lld, but we don't add it to sysroot

This commit is contained in:
Jakub Beránek 2023-12-07 12:34:54 +01:00
parent ea769dbeb7
commit 4750e9de47
No known key found for this signature in database
GPG Key ID: 909CD0D26483516B

View File

@ -1519,6 +1519,16 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
}
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