Skip to content

Commit 1b39302

Browse files
committed
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.
1 parent 1f76d21 commit 1b39302

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ pub(crate) fn target() -> Target {
77
base.cpu = "pentium4".into();
88
base.max_atomic_width = Some(64);
99
base.supported_sanitizers = SanitizerSet::ADDRESS;
10+
// On Windows 7 32-bit, the alignment characteristic of the TLS Directory
11+
// don't appear to be respected by the PE Loader, leading to crashes. As
12+
// a result, let's disable has_thread_local to make sure TLS goes through
13+
// the emulation layer.
14+
// See https://github.com/rust-lang/rust/issues/138903
15+
base.has_thread_local = false;
1016

1117
base.add_pre_link_args(
1218
LinkerFlavor::Msvc(Lld::No),

0 commit comments

Comments
 (0)