We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
compiler_builtins
Linkage
IncludedFromDylib
1 parent d047968 commit 8d69a1eCopy full SHA for 8d69a1e
compiler/rustc_codegen_ssa/src/back/link.rs
@@ -268,8 +268,14 @@ pub fn each_linked_rlib(
268
269
for &cnum in crates {
270
match fmts.get(cnum.as_usize() - 1) {
271
- Some(&Linkage::NotLinked | &Linkage::Dynamic | &Linkage::IncludedFromDylib) => continue,
272
- Some(_) => {}
+ Some(&Linkage::NotLinked | &Linkage::Dynamic) => continue,
+ Some(&Linkage::IncludedFromDylib) => {
273
+ // We always link crate `compiler_builtins` statically. When enabling LTO, we include it as well.
274
+ if info.compiler_builtins != Some(cnum) {
275
+ continue;
276
+ }
277
278
+ Some(&Linkage::Static) => {}
279
None => return Err(errors::LinkRlibError::MissingFormat),
280
}
281
let crate_name = info.crate_name[&cnum];
0 commit comments