File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1773,8 +1773,16 @@ fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
17731773
17741774// Returns true if linker is located within sysroot
17751775fn detect_self_contained_mingw ( sess : & Session ) -> bool {
1776- let linker = if let Some ( linker) = & sess. target . linker {
1777- Path :: new ( linker. as_ref ( ) )
1776+ // FIXME: this sort of duplicates `infer_from()` inside `linker_and_flavor()`
1777+ let path_buf = sess
1778+ . opts
1779+ . cg
1780+ . linker
1781+ . as_ref ( )
1782+ . map ( |l| l. as_path ( ) )
1783+ . or_else ( || sess. target . linker . as_ref ( ) . map ( |linker| Path :: new ( linker. as_ref ( ) ) ) ) ;
1784+ let linker = if let Some ( linker) = path_buf {
1785+ linker
17781786 } else {
17791787 return false ;
17801788 } ;
You can’t perform that action at this time.
0 commit comments