Skip to content

Commit 53ac852

Browse files
committed
Fail immediately if linking returns status code != 0
1 parent d44ea72 commit 53ac852

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc/back/write.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,13 @@ pub fn run_passes(sess: &Session,
714714
.stdout(::std::io::process::InheritFd(1))
715715
.stderr(::std::io::process::InheritFd(2));
716716
match cmd.status() {
717-
Ok(_) => {},
717+
Ok(status) => {
718+
if !status.success() {
719+
sess.err(format!("linking of {} with `{}` failed",
720+
output_path.display(), cmd).as_slice());
721+
sess.abort_if_errors();
722+
}
723+
},
718724
Err(e) => {
719725
sess.err(format!("could not exec the linker `{}`: {}",
720726
pname,

0 commit comments

Comments
 (0)