[clang] [Clang][Driver] Revise Cygwin ToolChain to call linker directly (PR #147960)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 17 14:41:09 PDT 2025


================
@@ -684,6 +684,8 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
 StringRef ToolChain::getOSLibName() const {
   if (Triple.isOSDarwin())
     return "darwin";
+  if (Triple.isWindowsCygwinEnvironment())
+    return "cygwin";
----------------
mstorsjo wrote:

What does the fallback (`getOS()` which defaults to `Triple.getOSName()`) return here, compared with this new value?

And I'm a little unsure how this change fits in with the rest of this change; isn't this change orthogonal to the rest? The rest of the change is about directly calling the linker (while still using the same libgcc etc as otherwise?), while this change is needed for e.g. getting the right directory for compiler-rt builtins and similar? I.e. this change might be ok in itself, but it feels to me like it's a separate change for a separate PR?

https://github.com/llvm/llvm-project/pull/147960


More information about the cfe-commits mailing list