mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add crate compiler_builtins
to LTO even if the Linkage
is IncludedFromDylib
This commit is contained in:
parent
d047968462
commit
8d69a1e69e
@ -268,8 +268,14 @@ pub fn each_linked_rlib(
|
||||
|
||||
for &cnum in crates {
|
||||
match fmts.get(cnum.as_usize() - 1) {
|
||||
Some(&Linkage::NotLinked | &Linkage::Dynamic | &Linkage::IncludedFromDylib) => continue,
|
||||
Some(_) => {}
|
||||
Some(&Linkage::NotLinked | &Linkage::Dynamic) => continue,
|
||||
Some(&Linkage::IncludedFromDylib) => {
|
||||
// We always link crate `compiler_builtins` statically. When enabling LTO, we include it as well.
|
||||
if info.compiler_builtins != Some(cnum) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Some(&Linkage::Static) => {}
|
||||
None => return Err(errors::LinkRlibError::MissingFormat),
|
||||
}
|
||||
let crate_name = info.crate_name[&cnum];
|
||||
|
Loading…
Reference in New Issue
Block a user