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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 11 05:06:46 PDT 2025


================
@@ -1504,6 +1506,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
   switch (Type) {
   case ToolChain::CST_Libcxx:
     CmdArgs.push_back("-lc++");
+    CmdArgs.push_back("-lc++abi");
----------------
tyan0 wrote:

Then, how about:
```diff
@@ -1504,6 +1506,8 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
   switch (Type) {
   case ToolChain::CST_Libcxx:
     CmdArgs.push_back("-lc++");
+    if (getTriple().isOSWindows())
+      CmdArgs.push_back("-lc++abi");
     if (Args.hasArg(options::OPT_fexperimental_library))
       CmdArgs.push_back("-lc++experimental");
     break;
```
? if COFF does not support that feature, adding this only for windows sounds reasonable to me.

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


More information about the cfe-commits mailing list