Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5238d17

Browse files
committed
fix TLS on partially supported OSes
1 parent c9b9c17 commit 5238d17

File tree

1 file changed

+9
-3
lines changed
  • src/tools/miri/src/shims

1 file changed

+9
-3
lines changed

src/tools/miri/src/shims/tls.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl TlsDtorsState {
240240
match &mut self.0 {
241241
Init => {
242242
match this.tcx.sess.target.os.as_ref() {
243-
"linux" => {
243+
"linux" | "freebsd" | "android" => {
244244
// Run the pthread dtors.
245245
self.0 = PthreadDtors(Default::default());
246246
}
@@ -257,10 +257,16 @@ impl TlsDtorsState {
257257
// And move to the final state.
258258
self.0 = Done;
259259
}
260-
_ => {
261-
// No TLS support for this platform, directly move to final state.
260+
"wasi" | "none" => {
261+
// No OS, no TLS dtors.
262+
// FIXME: should we do something on wasi?
262263
self.0 = Done;
263264
}
265+
os => {
266+
throw_unsup_format!(
267+
"the TLS machinery does not know how to handle OS `{os}`"
268+
);
269+
}
264270
}
265271
}
266272
PthreadDtors(state) => {

0 commit comments

Comments
 (0)