Skip to content

Commit 55877e5

Browse files
committed
Verify -C panic matches the panic runtime for executables
Helps alleviate choosing the wrong panic strategy by accident.
1 parent 490d1e3 commit 55877e5

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

text/0000-less-unwinding.md

+4-12
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,10 @@ attributes by the compiler:
140140
staticlibs. If no panic runtime is explicitly linked, then the compiler will
141141
select an appropriate runtime to inject.
142142
* Finally, the compiler will ensure that panic runtimes and compilation modes
143-
are not mismatched. For a resolved DAG, the panic runtime will have been
144-
compiled with a particular `-C panic` option, let's call it PS (panic
145-
strategy). If PS is "abort", then no validation is performed (doesn't matter
146-
how the rest of the DAG is compiled). Otherwise, all other crates must also
147-
be compiled with the same PS.
143+
are not mismatched. For a final product (outputs that aren't rlibs) the
144+
`-C panic` mode of the panic runtime must match the final product itself. If
145+
the panic mode is `abort`, then no other validation is performed, but
146+
otherwise all crates in the DAG must have the same value of `-C panic`.
148147

149148
The purpose of these limitations is to solve a number of problems that arise
150149
when switching panic strategies. For example with aborting panic crates won't
@@ -231,13 +230,6 @@ test` it cannot pass `-C panic=abort`.
231230
but without that option is this the best way to be implementing these switches
232231
for the standard library?
233232

234-
* Applications may silently revert to the wrong panic runtime given the
235-
heuristics here. For example if an application relies on unwinding panics, if
236-
a dependency is pulled in with an explicit `extern crate panic_abort`, then
237-
the entire application will switch to aborting panics silently. This can be
238-
corrected, however, with an explicit `extern crate panic_unwind` on behalf of
239-
the application.
240-
241233
# Alternatives
242234
[alternatives]: #alternatives
243235

0 commit comments

Comments
 (0)