@@ -686,8 +686,7 @@ fn link_natively(
686686) {
687687 info ! ( "preparing {:?} to {:?}" , crate_type, out_filename) ;
688688 let self_contained_components = self_contained_components ( sess, crate_type) ;
689- let ( linker_path, flavor) =
690- linker_and_flavor ( sess, self_contained_components. is_linker_enabled ( ) ) ;
689+ let ( linker_path, flavor) = linker_and_flavor ( sess, & self_contained_components) ;
691690
692691 // On AIX, we ship all libraries as .a big_af archive
693692 // the expected format is lib<name>.a(libname.so) for the actual
@@ -1319,7 +1318,10 @@ pub fn ignored_for_lto(sess: &Session, info: &CrateInfo, cnum: CrateNum) -> bool
13191318}
13201319
13211320/// This functions tries to determine the appropriate linker (and corresponding LinkerFlavor) to use
1322- pub fn linker_and_flavor ( sess : & Session , self_contained : bool ) -> ( PathBuf , LinkerFlavor ) {
1321+ pub fn linker_and_flavor (
1322+ sess : & Session ,
1323+ self_contained_components : & LinkSelfContainedComponents ,
1324+ ) -> ( PathBuf , LinkerFlavor ) {
13231325 fn infer_from (
13241326 sess : & Session ,
13251327 linker : Option < PathBuf > ,
@@ -1416,11 +1418,11 @@ pub fn linker_and_flavor(sess: &Session, self_contained: bool) -> (PathBuf, Link
14161418 return ret;
14171419 }
14181420
1419- // When using a supported target in self-contained mode, we want to use rust-lld directly.
1421+ // When using a supported target in self-contained linker mode, we want to use rust-lld directly.
14201422 let self_contained_target = sess. target . os == "windows"
14211423 && sess. target . env == "gnu"
14221424 && sess. target . abi == "llvm"
1423- && self_contained ;
1425+ && self_contained_components . is_linker_enabled ( ) ;
14241426 if self_contained_target
14251427 && let Some ( ret) =
14261428 infer_from ( sess, None , Some ( LinkerFlavor :: Gnu ( Cc :: No , Lld :: Yes ) ) , features)
0 commit comments