From 3787106be6e3a9be377aecc8600a2e57aa1afb58 Mon Sep 17 00:00:00 2001 From: nabijaczleweli Date: Thu, 29 Mar 2018 17:50:57 +0200 Subject: Also protect first attempt --- src/librustc_trans/back/link.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index 33f6ce9975e..46defb9e733 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -833,7 +833,11 @@ fn exec_linker(sess: &Session, cmd: &mut Command, out_filename: &Path, tmpdir: & // there instead of looking at the command line. if !cmd.very_likely_to_exceed_some_spawn_limit() { match cmd.command().stdout(Stdio::piped()).stderr(Stdio::piped()).spawn() { - Ok(child) => return child.wait_with_output(), + Ok(child) => { + let output = child.wait_with_output(); + flush_linked_file(&output, out_filename)?; + return output; + } Err(ref e) if command_line_too_big(e) => { info!("command line to linker was too big: {}", e); } -- cgit 1.4.1-3-g733a5