Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upadd a panic-strategy field to the target specification #36794
Conversation
rust-highfive
assigned
alexcrichton
Sep 28, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
|
travis failed, I think you need some stage1 cfg attributes
|
This comment has been minimized.
This comment has been minimized.
|
@oli-obk Thanks for the heads up. I don't think we need a cfg here because this is a test which can't be run against stage0 (stage1 already has the change to Option). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
jonathandturner
added a commit
to jonathandturner/rust
that referenced
this pull request
Sep 29, 2016
bors
added a commit
that referenced
this pull request
Sep 29, 2016
bors
merged commit 8a46e78
into
rust-lang:master
Sep 29, 2016
1 check passed
japaric
referenced this pull request
Oct 2, 2016
Closed
Add Cortex-M targets to the compiler + binary releases of `core` #1645
This comment has been minimized.
This comment has been minimized.
|
What happens when a Cargo file and target both specify the panic strategy? I'd prefer it if Cargo files specified a set of allowed panic strategies and then the target specification alone picked the one used. [Also, would be convenient to specify a map of names to targets in a (virtual) workspace root.] |
japaric
deleted the
japaric:target-panic
branch
Oct 2, 2016
This comment has been minimized.
This comment has been minimized.
|
@Ericson2314 Under the current implementation of Cargo, |
This comment has been minimized.
This comment has been minimized.
|
Ok, that seems good enough for now |
japaric commentedSep 28, 2016
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
PanicStrategyfrom therustcto therustc_backcrate.r? @alexcrichton
cc @phil-opp