Skip to content

Commit 3787106

Browse files
Also protect first attempt
1 parent cd09c2b commit 3787106

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_trans/back/link.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,11 @@ fn exec_linker(sess: &Session, cmd: &mut Command, out_filename: &Path, tmpdir: &
833833
// there instead of looking at the command line.
834834
if !cmd.very_likely_to_exceed_some_spawn_limit() {
835835
match cmd.command().stdout(Stdio::piped()).stderr(Stdio::piped()).spawn() {
836-
Ok(child) => return child.wait_with_output(),
836+
Ok(child) => {
837+
let output = child.wait_with_output();
838+
flush_linked_file(&output, out_filename)?;
839+
return output;
840+
}
837841
Err(ref e) if command_line_too_big(e) => {
838842
info!("command line to linker was too big: {}", e);
839843
}

0 commit comments

Comments
 (0)