You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This reworks this section to change the emphasis on "using non-rustc
linkers". To me, that seemed confusing, since this also applies to using
rustc (just that rustc automatically validates and generates an error if
it is validated).
Copy file name to clipboardExpand all lines: src/linkage.md
+4-6
Original file line number
Diff line number
Diff line change
@@ -279,10 +279,7 @@ r[link.unwinding]
279
279
### Prohibited linkage and unwinding
280
280
281
281
r[link.unwinding.intro]
282
-
If you are *not* using `rustc` to link Rust files, you must take care to ensure that unwinding is
283
-
handled consistently across the entire binary. Linking without `rustc` includes using `dlopen` or similar facilities
284
-
where linking is done by the system runtime without `rustc` being involved. In the following,
285
-
we define what exactly is meant by "handling unwinding consistently".
282
+
Panic unwinding must be supported consistently across the binary per the following rules.
286
283
287
284
r[link.unwinding.potential]
288
285
A Rust artifact is called *potentially unwinding* if any of the following conditions is met:
@@ -301,8 +298,9 @@ r[link.unwinding.prohibited]
301
298
If a Rust artifact is potentially unwinding, then all its crates must be built with the `unwind`[panic strategy].
302
299
303
300
> [!NOTE]
304
-
> This restriction can only be violated when mixing code with different [`-C panic`] flags
305
-
> while also using a non-`rustc` linker. Most users do not have to be concerned about this.
301
+
> If you are *not* using `rustc` to link, you must take care to ensure that unwinding is handled consistently across the entire binary. Linking without `rustc` includes using `dlopen` or similar facilities where linking is done by the system runtime without `rustc` being involved.
302
+
>
303
+
> This can only happen when mixing code with different [`-C panic`] flags, so most users do not have to be concerned about this.
306
304
307
305
> [!NOTE]
308
306
> To guarantee that a library will be sound (and linkable with `rustc`)
Copy file name to clipboardExpand all lines: src/panic.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,8 @@ The _panic strategy_ defines the kind of panic runtime that a crate is built to
49
49
> [!NOTE]
50
50
> When compiling code with the `abort` panic strategy, the optimizer may assume that unwinding across Rust frames is impossible, which can result in both code-size and runtime speed improvements.
51
51
52
-
r[panic.strategy.mixed]
53
-
When linking with the `unwind` runtime, all crates must be built with the `unwind` strategy.
52
+
> [!NOTE]
53
+
> See [link.unwinding] for restrictions on linking crates with different panic strategies. An implication is that crates built with the `unwind` strategy can use the `abort` runtime, but not vice-versa.
0 commit comments