@@ -563,7 +563,7 @@ fn link_staticlib(sess: &Session,
563563 } ) ;
564564 ab. add_rlib ( path,
565565 & name. as_str ( ) ,
566- is_full_lto_enabled ( sess) &&
566+ are_upstream_rust_objects_already_included ( sess) &&
567567 !ignored_for_lto ( sess, & codegen_results. crate_info , cnum) ,
568568 skip_object_files) . unwrap ( ) ;
569569
@@ -1446,7 +1446,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
14461446 lib. kind == NativeLibraryKind :: NativeStatic && !relevant_lib ( sess, lib)
14471447 } ) ;
14481448
1449- if ( !is_full_lto_enabled ( sess) ||
1449+ if ( !are_upstream_rust_objects_already_included ( sess) ||
14501450 ignored_for_lto ( sess, & codegen_results. crate_info , cnum) ) &&
14511451 crate_type != config:: CrateType :: Dylib &&
14521452 !skip_native {
@@ -1500,7 +1500,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
15001500 // file, then we don't need the object file as it's part of the
15011501 // LTO module. Note that `#![no_builtins]` is excluded from LTO,
15021502 // 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) &&
15041504 is_rust_object &&
15051505 ( sess. target . target . options . no_builtins ||
15061506 !codegen_results. crate_info . is_no_builtins . contains ( & cnum) ) ;
@@ -1537,7 +1537,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
15371537 fn add_dynamic_crate ( cmd : & mut dyn Linker , sess : & Session , cratepath : & Path ) {
15381538 // If we're performing LTO, then it should have been previously required
15391539 // 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) ) ;
15411541
15421542 // Just need to tell the linker about where the library lives and
15431543 // what its name is
@@ -1623,7 +1623,7 @@ fn relevant_lib(sess: &Session, lib: &NativeLibrary) -> bool {
16231623 }
16241624}
16251625
1626- fn is_full_lto_enabled ( sess : & Session ) -> bool {
1626+ fn are_upstream_rust_objects_already_included ( sess : & Session ) -> bool {
16271627 match sess. lto ( ) {
16281628 Lto :: Yes |
16291629 Lto :: Fat => true ,
0 commit comments