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>
This commit is contained in:
Peter Atashian 2016-05-31 16:14:34 -04:00
parent 298730e703
commit d34ad3c3b2
No known key found for this signature in database
GPG Key ID: DE04D9E27559BC8A

View File

@ -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();
}
}