]> granicus.if.org Git - clang/commitdiff
Driver/Darwin: Catch another case where ld ends up using ld_classic.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 7 Sep 2010 17:50:41 +0000 (17:50 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 7 Sep 2010 17:50:41 +0000 (17:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113226 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 0215cdfa6116867b8e00ec393b7533e55ce6a0a3..24d05c1b27be1dc5b6c6e4eccf5872260a880fa3 100644 (file)
@@ -2209,6 +2209,16 @@ void darwin::Link::AddLinkArgs(const ArgList &Args,
     // FIXME: This is a temporary workaround, ld should be handling this.
     bool UsesLdClassic = (getToolChain().getArch() == llvm::Triple::x86 &&
                           Args.hasArg(options::OPT_static));
+    if (getToolChain().getArch() == llvm::Triple::x86) {
+      for (arg_iterator it = Args.filtered_begin(options::OPT_Xlinker,
+                                                 options::OPT_Wl_COMMA),
+             ie = Args.filtered_end(); it != ie; ++it) {
+        const Arg *A = *it;
+        for (unsigned i = 0, e = A->getNumValues(); i != e; ++i)
+          if (llvm::StringRef(A->getValue(Args, i)) == "-kext")
+            UsesLdClassic = true;
+      }
+    }
     if (!UsesLdClassic)
       CmdArgs.push_back("-demangle");
   }