]> git.lizzy.rs Git - rust.git/commit
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)
commit9143c3c9c0beca5185abd943203eb7c5ebcf8e49
tree7c6975321bfa03d2beb89b21fa19747ffa6e9717
parentf1ea5cc273d425033ad430c8fbc28bae1013b45a
parent8a46e78e64dee2c85ba097081ddff027322e93d3
Rollup merge of #36794 - japaric:target-panic, r=alexcrichton

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
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