diff options
| author | nabijaczleweli <nabijaczleweli@gmail.com> | 2018-03-29 17:50:57 +0200 |
|---|---|---|
| committer | nabijaczleweli <nabijaczleweli@gmail.com> | 2018-03-29 17:50:57 +0200 |
| commit | 3787106be6e3a9be377aecc8600a2e57aa1afb58 (patch) | |
| tree | fa01429011d97a19041bd6ed47a91e186d547f2d /src | |
| parent | cd09c2b2abf2c03b80d0d48c9828004ade64a8f8 (diff) | |
| download | rust-3787106be6e3a9be377aecc8600a2e57aa1afb58.tar.gz rust-3787106be6e3a9be377aecc8600a2e57aa1afb58.zip | |
Also protect first attempt
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_trans/back/link.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |
