Commit d113be9
committed
Emit unwind tables by default with
Otherwise backtraces (in e.g. the default panic hook) are incomplete.
More details
The linux backtrace unwinder relies on unwind tables to work properly.
The default panic hook prints backtraces. Backtraces with
`-C panic=abort` used to work in Rust 1.22 but broke in Rust 1.23, because
in 1.23 we stopped emitting unwind tables with `-C panic=abort` (see
24cc38e).
In 1.45 (see cda9946) a workaround in the form of
`-C force-unwind-tables=yes` was added.
More history
`-C panic=abort` was added in [Rust
1.10](https://blog.rust-lang.org/2016/07/07/Rust-1.10/#what-s-in-1-10-stable)
and the motivation was binary size and compile time. But given how
confusing that behavior has turned out to be, it is better to make
binary size optimzation opt-in with `-C force-unwind-tables=no` rather
than default since the current default breaks backtraces.
Besides, if binary size is a primary concern, there are many other
tricks that can be used that has a higher impact.
TODO:
- [ ] better commit message
- [ ] more tests?
- [ ] figure out how to present this in release notes
- [ ] check if all tests pass-Cpanic=abort on linux1 parent 1b0bc59 commit d113be9
File tree
4 files changed
+7
-8
lines changed- compiler
- rustc_session/src
- rustc_target/src/spec/base
- tests/run-make/panic-abort-eh_frame
4 files changed
+7
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
| 805 | + | |
| 806 | + | |
805 | 807 | | |
806 | | - | |
807 | | - | |
808 | | - | |
| 808 | + | |
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
0 commit comments