about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Atashian <retep998@gmail.com>2016-05-31 16:14:34 -0400
committerPeter Atashian <retep998@gmail.com>2016-05-31 16:29:12 -0400
commitd34ad3c3b2c5ec3edb3bd33638f61436da4f2fe0 (patch)
tree2daa345c34d2c1e0d03085f8b656759bd024d259
parent298730e7032cd55809423773da397cd5c7d827d4 (diff)
downloadrust-d34ad3c3b2c5ec3edb3bd33638f61436da4f2fe0.tar.gz
rust-d34ad3c3b2c5ec3edb3bd33638f61436da4f2fe0.zip
Print linker arguments if calling the linker fails
Needed to diagnose https://github.com/rust-lang/rust/issues/33844

Signed-off-by: Peter Atashian <retep998@gmail.com>
-rw-r--r--src/librustc_trans/back/link.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 4640377cf86..6e5964d83c0 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -692,7 +692,11 @@ fn link_natively(sess: &Session,
             info!("linker stdout:\n{}", escape_string(&prog.stdout[..]));
         },
         Err(e) => {
-            sess.fatal(&format!("could not exec the linker `{}`: {}", pname, e));
+            // Trying to diagnose https://github.com/rust-lang/rust/issues/33844
+            sess.struct_err(&format!("could not exec the linker `{}`: {}", pname, e))
+                .note(&format!("{:?}", &cmd))
+                .emit();
+            sess.abort_if_errors();
         }
     }