about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-01 19:35:45 +0200
committerGitHub <noreply@github.com>2025-06-01 19:35:45 +0200
commitf714b34000715a0c4feb5fd668c377a56c03b895 (patch)
tree07e5e8de5109b93d474e9b3ccb2cc028a6d6c2dc /src/bootstrap
parentfc32992a00b1a261dfe12eed2bbd9dc91cab41b5 (diff)
parent810a564d9b80429e31eea198faf735712229a968 (diff)
downloadrust-f714b34000715a0c4feb5fd668c377a56c03b895.tar.gz
rust-f714b34000715a0c4feb5fd668c377a56c03b895.zip
Rollup merge of #141846 - Berrysoft:cygwin-bootstrap-tls, r=mati865
Fix TLS model on bootstrap for cygwin

There aren't other targets that both use emutls and enable `has_thread_local`, so cygwin triggers this bug first.

r? mati865

See: https://github.com/rust-lang/rust/pull/141719#issuecomment-2925445263

``@jeremyd2019`` Could you check if this PR fixes the issue? I just found my pre-built stage-0 rustc was too old to build the current rustc :(
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/builder/cargo.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index e41f6f16b02..51556525bc9 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -1004,7 +1004,12 @@ impl Builder<'_> {
         // efficient initial-exec TLS model. This doesn't work with `dlopen`,
         // so we can't use it by default in general, but we can use it for tools
         // and our own internal libraries.
-        if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") {
+        //
+        // Cygwin only supports emutls.
+        if !mode.must_support_dlopen()
+            && !target.triple.starts_with("powerpc-")
+            && !target.triple.contains("cygwin")
+        {
             cargo.env("RUSTC_TLS_MODEL_INITIAL_EXEC", "1");
         }