Meziu / rust-horizon

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
3 stars 1 forks source link

Enable `#[cfg(target_thread_local)]` #15

Closed ian-h-chamberlain closed 2 years ago

ian-h-chamberlain commented 2 years ago

This is falling out from the discussion in https://github.com/Meziu/pthread-3ds/pull/13

Based on https://github.com/rust-lang/rust/issues/91659 – many targets default to false for has_thread_local, including armv6k-nintendo-3ds. Based on our testing #[thread_local] does work on this platform, and as someone pointed out it appears all ARM targets actually support the #[thread_local] attribute.

I think we should add has_thread_local: true to take advantage of the "fast" thread-local support builtin to std: https://github.com/Meziu/rust-horizon/blob/horizon-std/library/std/src/thread/mod.rs#L186

I can do it (trivial change) but I wanted to make sure everyone's on board before submitting a PR to update the target. I'm building a local version of the compiler to test as well.

AzureMarker commented 2 years ago

Sounds good, open a PR and we can test and discuss there too.

AzureMarker commented 2 years ago

This was merged into upstream in https://github.com/rust-lang/rust/pull/95341 (I don't have permission to close this issue myself)