]> git.lizzy.rs Git - rust.git/commitdiff
Print linker arguments if calling the linker fails
authorPeter Atashian <retep998@gmail.com>
Tue, 31 May 2016 20:14:34 +0000 (16:14 -0400)
committerPeter Atashian <retep998@gmail.com>
Tue, 31 May 2016 20:29:12 +0000 (16:29 -0400)
Needed to diagnose https://github.com/rust-lang/rust/issues/33844

Signed-off-by: Peter Atashian <retep998@gmail.com>
src/librustc_trans/back/link.rs

index 4640377cf86005bc1dee0c192d44a48ca05906a8..6e5964d83c064a9eef4299fd5bccc5c4896c2840 100644 (file)
@@ -692,7 +692,11 @@ fn escape_string(s: &[u8]) -> String {
             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();
         }
     }