@@ -563,7 +563,7 @@ fn link_staticlib(sess: &Session,
563
563
} ) ;
564
564
ab. add_rlib ( path,
565
565
& name. as_str ( ) ,
566
- is_full_lto_enabled ( sess) &&
566
+ are_upstream_rust_objects_already_included ( sess) &&
567
567
!ignored_for_lto ( sess, & codegen_results. crate_info , cnum) ,
568
568
skip_object_files) . unwrap ( ) ;
569
569
@@ -1446,7 +1446,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
1446
1446
lib. kind == NativeLibraryKind :: NativeStatic && !relevant_lib ( sess, lib)
1447
1447
} ) ;
1448
1448
1449
- if ( !is_full_lto_enabled ( sess) ||
1449
+ if ( !are_upstream_rust_objects_already_included ( sess) ||
1450
1450
ignored_for_lto ( sess, & codegen_results. crate_info , cnum) ) &&
1451
1451
crate_type != config:: CrateType :: Dylib &&
1452
1452
!skip_native {
@@ -1500,7 +1500,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
1500
1500
// file, then we don't need the object file as it's part of the
1501
1501
// LTO module. Note that `#![no_builtins]` is excluded from LTO,
1502
1502
// though, so we let that object file slide.
1503
- let skip_because_lto = is_full_lto_enabled ( sess) &&
1503
+ let skip_because_lto = are_upstream_rust_objects_already_included ( sess) &&
1504
1504
is_rust_object &&
1505
1505
( sess. target . target . options . no_builtins ||
1506
1506
!codegen_results. crate_info . is_no_builtins . contains ( & cnum) ) ;
@@ -1537,7 +1537,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
1537
1537
fn add_dynamic_crate ( cmd : & mut dyn Linker , sess : & Session , cratepath : & Path ) {
1538
1538
// If we're performing LTO, then it should have been previously required
1539
1539
// that all upstream rust dependencies were available in an rlib format.
1540
- assert ! ( !is_full_lto_enabled ( sess) ) ;
1540
+ assert ! ( !are_upstream_rust_objects_already_included ( sess) ) ;
1541
1541
1542
1542
// Just need to tell the linker about where the library lives and
1543
1543
// what its name is
@@ -1623,7 +1623,7 @@ fn relevant_lib(sess: &Session, lib: &NativeLibrary) -> bool {
1623
1623
}
1624
1624
}
1625
1625
1626
- fn is_full_lto_enabled ( sess : & Session ) -> bool {
1626
+ fn are_upstream_rust_objects_already_included ( sess : & Session ) -> bool {
1627
1627
match sess. lto ( ) {
1628
1628
Lto :: Yes |
1629
1629
Lto :: Fat => true ,
0 commit comments