]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #36794 - japaric:target-panic, r=alexcrichton
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Thu, 29 Sep 2016 03:21:52 +0000 (20:21 -0700)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2016 03:21:52 +0000 (20:21 -0700)
add a panic-strategy field to the target specification

Now a target can define its panic strategy in its specification. If a
user doesn't specify a panic strategy via the command line, i.e. '-C
panic', then the compiler will use the panic strategy defined by the
target specification.

Custom targets can pick their panic strategy via the "panic-strategy"
field of their target specification JSON file. If omitted in the
specification, the strategy defaults to "unwind".

closes #36647

---

I checked that compiling an executable for a custom target with "panic-strategy" set to "abort" doesn't need the "eh_personality" lang item and also that standard crates compiled for that custom target didn't contained undefined symbols to _Unwind_Resume. But this needs an actual unit test, any suggestion on how to test this?

Most of the noise in the diff is due to moving `PanicStrategy` from the `rustc` to the `rustc_back` crate.

r? @alexcrichton
cc @phil-opp

1  2 
src/librustc/middle/cstore.rs
src/librustc/session/config.rs
src/librustc/session/mod.rs
src/librustc_back/target/mod.rs
src/librustc_metadata/creader.rs

Simple merge
Simple merge
Simple merge
Simple merge
index 2e03b7868a3bc8fe18d293435652eb03f4131c19,be908ff9d19d90e1fa7c84a7e76dd6ad0facf325..0c7f6204438a78803b21456fa7f94fb60153069b
@@@ -17,9 -17,8 +17,9 @@@ use schema::CrateRoot
  
  use rustc::hir::def_id::{CrateNum, DefIndex};
  use rustc::hir::svh::Svh;
 +use rustc::middle::cstore::LoadedMacro;
  use rustc::session::{config, Session};
- use rustc::session::config::PanicStrategy;
+ use rustc_back::PanicStrategy;
  use rustc::session::search_paths::PathKind;
  use rustc::middle;
  use rustc::middle::cstore::{CrateStore, validate_crate_name, ExternCrate};