about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorroblabla <unfiltered@roblab.la>2025-04-18 13:30:26 +0200
committerroblabla <unfiltered@roblab.la>2025-04-18 13:30:26 +0200
commit1b393025718ca9c75d67e82b55a390e3506e536c (patch)
tree9ba937e519836a17720220510d98c01161582629 /compiler
parent1f76d219c906f0112bb1872f33aa977164c53fa6 (diff)
downloadrust-1b393025718ca9c75d67e82b55a390e3506e536c.tar.gz
rust-1b393025718ca9c75d67e82b55a390e3506e536c.zip
Disable has_thread_local on i686-win7-windows-msvc
On Windows 7 32-bit, the alignment characteristic of the TLS Directory
don't appear to be respected by the PE Loader, leading to crashes. As
a result, let's disable has_thread_local to make sure TLS goes through
the emulation layer.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs
index 233a1c4fd7a..91ab3111097 100644
--- a/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs
@@ -7,6 +7,12 @@ pub(crate) fn target() -> Target {
     base.cpu = "pentium4".into();
     base.max_atomic_width = Some(64);
     base.supported_sanitizers = SanitizerSet::ADDRESS;
+    // On Windows 7 32-bit, the alignment characteristic of the TLS Directory
+    // don't appear to be respected by the PE Loader, leading to crashes. As
+    // a result, let's disable has_thread_local to make sure TLS goes through
+    // the emulation layer.
+    // See https://github.com/rust-lang/rust/issues/138903
+    base.has_thread_local = false;
 
     base.add_pre_link_args(
         LinkerFlavor::Msvc(Lld::No),