Skip to content

Commit ba4678f

Browse files
committed
---
yaml --- r: 225083 b: refs/heads/stable c: eb50ffd h: refs/heads/master i: 225081: 2ca0253 225079: 72d9dd2 v: v3
1 parent 8027f45 commit ba4678f

File tree

2 files changed

+19
-31
lines changed

2 files changed

+19
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: e2854b38932e9cc3aa5ac09b55b59845919860c4
32+
refs/heads/stable: eb50ffd2343eef3afcfbf0696d04fcc3fe8a075a
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/src/librustc_trans/back/link.rs

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ fn link_rlib<'a>(sess: &'a Session,
546546
trans: Option<&CrateTranslation>, // None == no metadata/bytecode
547547
obj_filename: &Path,
548548
out_filename: &Path) -> ArchiveBuilder<'a> {
549+
info!("preparing rlib from {:?} to {:?}", obj_filename, out_filename);
549550
let handler = &sess.diagnostic().handler;
550551
let config = ArchiveConfig {
551552
handler: handler,
@@ -560,9 +561,7 @@ fn link_rlib<'a>(sess: &'a Session,
560561

561562
for &(ref l, kind) in &*sess.cstore.get_used_libraries().borrow() {
562563
match kind {
563-
cstore::NativeStatic => {
564-
ab.add_native_library(&l[..]).unwrap();
565-
}
564+
cstore::NativeStatic => ab.add_native_library(&l).unwrap(),
566565
cstore::NativeFramework | cstore::NativeUnknown => {}
567566
}
568567
}
@@ -613,10 +612,8 @@ fn link_rlib<'a>(sess: &'a Session,
613612
}) {
614613
Ok(..) => {}
615614
Err(e) => {
616-
sess.err(&format!("failed to write {}: {}",
617-
metadata.display(),
618-
e));
619-
sess.abort_if_errors();
615+
sess.fatal(&format!("failed to write {}: {}",
616+
metadata.display(), e));
620617
}
621618
}
622619
ab.add_file(&metadata).unwrap();
@@ -658,9 +655,8 @@ fn link_rlib<'a>(sess: &'a Session,
658655
&bc_data_deflated) {
659656
Ok(()) => {}
660657
Err(e) => {
661-
sess.err(&format!("failed to write compressed bytecode: \
662-
{}", e));
663-
sess.abort_if_errors()
658+
sess.fatal(&format!("failed to write compressed \
659+
bytecode: {}", e));
664660
}
665661
};
666662

@@ -794,6 +790,8 @@ fn link_staticlib(sess: &Session, obj_filename: &Path, out_filename: &Path) {
794790
// links to all upstream files as well.
795791
fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
796792
obj_filename: &Path, out_filename: &Path) {
793+
info!("preparing dylib? ({}) from {:?} to {:?}", dylib, obj_filename,
794+
out_filename);
797795
let tmpdir = TempDir::new("rustc").ok().expect("needs a temp dir");
798796

799797
// The invocations of cc share some flags across platforms
@@ -827,7 +825,7 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
827825
sess.abort_if_errors();
828826

829827
// Invoke the system linker
830-
debug!("{:?}", &cmd);
828+
info!("{:?}", &cmd);
831829
let prog = time(sess.time_passes(), "running linker", (), |()| cmd.output());
832830
match prog {
833831
Ok(prog) => {
@@ -841,14 +839,11 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
841839
sess.note(str::from_utf8(&output[..]).unwrap());
842840
sess.abort_if_errors();
843841
}
844-
debug!("linker stderr:\n{}", String::from_utf8(prog.stderr).unwrap());
845-
debug!("linker stdout:\n{}", String::from_utf8(prog.stdout).unwrap());
842+
info!("linker stderr:\n{}", String::from_utf8(prog.stderr).unwrap());
843+
info!("linker stdout:\n{}", String::from_utf8(prog.stdout).unwrap());
846844
},
847845
Err(e) => {
848-
sess.err(&format!("could not exec the linker `{}`: {}",
849-
pname,
850-
e));
851-
sess.abort_if_errors();
846+
sess.fatal(&format!("could not exec the linker `{}`: {}", pname, e));
852847
}
853848
}
854849

@@ -858,10 +853,7 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
858853
if sess.target.target.options.is_like_osx && sess.opts.debuginfo != NoDebugInfo {
859854
match Command::new("dsymutil").arg(out_filename).output() {
860855
Ok(..) => {}
861-
Err(e) => {
862-
sess.err(&format!("failed to run dsymutil: {}", e));
863-
sess.abort_if_errors();
864-
}
856+
Err(e) => sess.fatal(&format!("failed to run dsymutil: {}", e)),
865857
}
866858
}
867859
}
@@ -1157,11 +1149,9 @@ fn add_upstream_rust_crates(cmd: &mut Linker, sess: &Session,
11571149
match fs::copy(&cratepath, &dst) {
11581150
Ok(..) => {}
11591151
Err(e) => {
1160-
sess.err(&format!("failed to copy {} to {}: {}",
1161-
cratepath.display(),
1162-
dst.display(),
1163-
e));
1164-
sess.abort_if_errors();
1152+
sess.fatal(&format!("failed to copy {} to {}: {}",
1153+
cratepath.display(),
1154+
dst.display(), e));
11651155
}
11661156
}
11671157
// Fix up permissions of the copy, as fs::copy() preserves
@@ -1174,10 +1164,8 @@ fn add_upstream_rust_crates(cmd: &mut Linker, sess: &Session,
11741164
}) {
11751165
Ok(..) => {}
11761166
Err(e) => {
1177-
sess.err(&format!("failed to chmod {} when preparing \
1178-
for LTO: {}", dst.display(),
1179-
e));
1180-
sess.abort_if_errors();
1167+
sess.fatal(&format!("failed to chmod {} when preparing \
1168+
for LTO: {}", dst.display(), e));
11811169
}
11821170
}
11831171
let handler = &sess.diagnostic().handler;

0 commit comments

Comments
 (0)