From 926c5b8ab05217855f403c588ac6f684ac77dbd9 Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov Date: Tue, 25 Aug 2026 14:11:09 +0300 Subject: [PATCH] do not compress debuginfo for Cygwin when I updated Rust for MSYS, I got errors from gcc regarding -Wl,--compress-debug-sections=zlib flag being unsupported. so don't add it for all Cygwin hosts --- src/bootstrap/src/core/builder/cargo.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index c02fd567ac6c9..6f319d7da44d4 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -399,7 +399,9 @@ impl Cargo { // Do not enable Zlib compression on: // - Windows, because MSVC/PDB doesn't support it // - macOS, because its linker doesn't know the flag - if !self.target.is_windows() && !self.target.is_apple() { + // - Cygwin, because its linker may not support the flag + if !self.target.is_windows() && !self.target.is_apple() && !self.target.is_cygwin() + { // If we link through cc, we need the -Wl prefix. // If we don't, then we must not add it, because the linker wouldn't // understand it.