[PATCH] D132440: [Clang] Avoid using unwind library in the MSVC environment

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 00:30:07 PDT 2022


phosek created this revision.
phosek added a reviewer: mstorsjo.
Herald added a project: All.
phosek requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

We're seeing the following warnings with --rtlib=compiler-rt:

    
  lld-link: warning: ignoring unknown argument '--as-needed'
  lld-link: warning: ignoring unknown argument '-lunwind'
  lld-link: warning: ignoring unknown argument '--no-as-needed'
    

MSVC doesn't use the unwind library, so just omit it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132440

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp


Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1510,7 +1510,7 @@
   // Targets that don't use unwind libraries.
   if ((TC.getTriple().isAndroid() && UNW == ToolChain::UNW_Libgcc) ||
       TC.getTriple().isOSIAMCU() || TC.getTriple().isOSBinFormatWasm() ||
-      UNW == ToolChain::UNW_None)
+      TC.getTriple().isWindowsMSVCEnvironment() || UNW == ToolChain::UNW_None)
     return;
 
   LibGccType LGT = getLibGccType(TC, D, Args);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132440.454717.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220823/3fdb031c/attachment.bin>


More information about the cfe-commits mailing list