Skip to content

Commit 06c5abb

Browse files
committedJul 16, 2017
Auto merge of #43258 - petrochenkov:cbabort, r=alexcrichton
Compile `compiler_builtins` with `abort` panic strategy A workaround for #43095 In case this causes unexpected consequences, I use a simpler workaround locally: ```diff --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -175,7 +175,9 @@ fn main() { } if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") { - cmd.arg("-C").arg(format!("codegen-units={}", s)); + if crate_name != "compiler_builtins" { + cmd.arg("-C").arg(format!("codegen-units={}", s)); + } } // Emit save-analysis info. ``` r? @alexcrichton
2 parents 8f1339a + 5f37110 commit 06c5abb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎src/bootstrap/bin/rustc.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ fn main() {
150150
// This... is a bit of a hack how we detect this. Ideally this
151151
// information should be encoded in the crate I guess? Would likely
152152
// require an RFC amendment to RFC 1513, however.
153-
if crate_name == "panic_abort" {
153+
//
154+
// `compiler_builtins` are unconditionally compiled with panic=abort to
155+
// workaround undefined references to `rust_eh_unwind_resume` generated
156+
// otherwise, see issue https://github.com/rust-lang/rust/issues/43095.
157+
if crate_name == "panic_abort" ||
158+
crate_name == "compiler_builtins" && stage != "0" {
154159
cmd.arg("-C").arg("panic=abort");
155160
}
156161

‎src/librustc/middle/dependency_format.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ fn verify_ok<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, list: &[Linkage]) {
396396
}
397397
let cnum = CrateNum::new(i + 1);
398398
let found_strategy = sess.cstore.panic_strategy(cnum);
399-
if desired_strategy == found_strategy {
399+
let is_compiler_builtins = sess.cstore.is_compiler_builtins(cnum);
400+
if is_compiler_builtins || desired_strategy == found_strategy {
400401
continue
401402
}
402403

0 commit comments

Comments
 (0)