@@ -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 > ,
@@ -1418,11 +1420,11 @@ pub fn linker_and_flavor(sess: &Session, self_contained: bool) -> (PathBuf, Link
14181420 return ret;
14191421 }
14201422
1421- // When using a supported target in self-contained mode, we want to use rust-lld directly.
1423+ // When using a supported target in self-contained linker mode, we want to use rust-lld directly.
14221424 let self_contained_target = sess. target . os == "windows"
14231425 && sess. target . env == "gnu"
14241426 && sess. target . abi == "llvm"
1425- && self_contained ;
1427+ && self_contained_components . is_linker_enabled ( ) ;
14261428 if self_contained_target
14271429 && let Some ( ret) =
14281430 infer_from ( sess, None , Some ( LinkerFlavor :: Gnu ( Cc :: No , Lld :: Yes ) ) , features)
0 commit comments