about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-11-27 13:19:54 +0100
committerRalf Jung <post@ralfj.de>2022-11-28 08:53:14 +0100
commit5238d1779778097d0bcf3a9fc83bb4a37732cb3e (patch)
tree0f4bf19816a9b0f394ed46b80b020c1499da75fb
parentc9b9c17fca0d781aa9e80180b605bff3cb1db038 (diff)
downloadrust-5238d1779778097d0bcf3a9fc83bb4a37732cb3e.tar.gz
rust-5238d1779778097d0bcf3a9fc83bb4a37732cb3e.zip
fix TLS on partially supported OSes
-rw-r--r--src/tools/miri/src/shims/tls.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tools/miri/src/shims/tls.rs b/src/tools/miri/src/shims/tls.rs
index 65978c9774f..fe278ff717f 100644
--- a/src/tools/miri/src/shims/tls.rs
+++ b/src/tools/miri/src/shims/tls.rs
@@ -240,7 +240,7 @@ impl TlsDtorsState {
         match &mut self.0 {
             Init => {
                 match this.tcx.sess.target.os.as_ref() {
-                    "linux" => {
+                    "linux" | "freebsd" | "android" => {
                         // Run the pthread dtors.
                         self.0 = PthreadDtors(Default::default());
                     }
@@ -257,10 +257,16 @@ impl TlsDtorsState {
                         // And move to the final state.
                         self.0 = Done;
                     }
-                    _ => {
-                        // No TLS support for this platform, directly move to final state.
+                    "wasi" | "none" => {
+                        // No OS, no TLS dtors.
+                        // FIXME: should we do something on wasi?
                         self.0 = Done;
                     }
+                    os => {
+                        throw_unsup_format!(
+                            "the TLS machinery does not know how to handle OS `{os}`"
+                        );
+                    }
                 }
             }
             PthreadDtors(state) => {