fix TLS on partially supported OSes
This commit is contained in:
parent
c9b9c17fca
commit
5238d17797
@ -240,7 +240,7 @@ pub fn on_stack_empty<'tcx>(
|
||||
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 @@ pub fn on_stack_empty<'tcx>(
|
||||
// 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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user