Skip to content

Commit ad5fbaf

Browse files
committed
Auto merge of #33979 - retep998:why-the-long-face, r=alexcrichton
Attempt to diagnose #33844 #33844 is a spurious failure that causes builds to fail due to the linker command sometimes failing with error 206, which means that the command is too long. This PR makes rustc print out the linker arguments in that case so the reason for it being so long can be diagnosed and hopefully fixed. r? @alexcrichton
2 parents 601eb13 + d34ad3c commit ad5fbaf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_trans/back/link.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,11 @@ fn link_natively(sess: &Session,
692692
info!("linker stdout:\n{}", escape_string(&prog.stdout[..]));
693693
},
694694
Err(e) => {
695-
sess.fatal(&format!("could not exec the linker `{}`: {}", pname, e));
695+
// Trying to diagnose https://github.com/rust-lang/rust/issues/33844
696+
sess.struct_err(&format!("could not exec the linker `{}`: {}", pname, e))
697+
.note(&format!("{:?}", &cmd))
698+
.emit();
699+
sess.abort_if_errors();
696700
}
697701
}
698702

0 commit comments

Comments
 (0)