1
Fork 0

Actually use self-contained lld in bootstrap when use-lld = "self-contained" is used

Before, we just used the global `lld` anyway.
This commit is contained in:
Jakub Beránek 2025-01-01 18:49:07 +01:00
parent eeeff9a66c
commit ab5446c992

View file

@ -475,7 +475,20 @@ pub fn linker_flags(
) -> Vec<String> { ) -> Vec<String> {
let mut args = vec![]; let mut args = vec![];
if !builder.is_lld_direct_linker(target) && builder.config.lld_mode.is_used() { if !builder.is_lld_direct_linker(target) && builder.config.lld_mode.is_used() {
args.push(String::from("-Clink-arg=-fuse-ld=lld")); match builder.config.lld_mode {
LldMode::External => {
args.push("-Clinker-flavor=gnu-lld-cc".to_string());
// FIXME(kobzol): remove this flag once MCP510 gets stabilized
args.push("-Zunstable-options".to_string());
}
LldMode::SelfContained => {
args.push("-Clinker-flavor=gnu-lld-cc".to_string());
args.push("-Clink-self-contained=+linker".to_string());
// FIXME(kobzol): remove this flag once MCP510 gets stabilized
args.push("-Zunstable-options".to_string());
}
LldMode::Unused => unreachable!(),
};
if matches!(lld_threads, LldThreads::No) { if matches!(lld_threads, LldThreads::No) {
args.push(format!( args.push(format!(