From d34ad3c3b2c5ec3edb3bd33638f61436da4f2fe0 Mon Sep 17 00:00:00 2001 From: Peter Atashian Date: Tue, 31 May 2016 16:14:34 -0400 Subject: [PATCH] Print linker arguments if calling the linker fails Needed to diagnose https://github.com/rust-lang/rust/issues/33844 Signed-off-by: Peter Atashian --- src/librustc_trans/back/link.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index 4640377cf8600..6e5964d83c064 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(); } }