]> granicus.if.org Git - clang/commitdiff
Driver/Darwin: Don't pass -demangle to the linker when we know it is going to
authorDaniel Dunbar <daniel@zuster.org>
Tue, 7 Sep 2010 17:07:49 +0000 (17:07 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 7 Sep 2010 17:07:49 +0000 (17:07 +0000)
use ld_classic. This is a temporary workaround, the linkr itself should handle
this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113212 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index a055904a892fc69009b7b810bf37d696ce09d5ac..0215cdfa6116867b8e00ec393b7533e55ce6a0a3 100644 (file)
@@ -2204,7 +2204,13 @@ void darwin::Link::AddLinkArgs(const ArgList &Args,
   // Newer linkers support -demangle, pass it if supported and not disabled by
   // the user.
   if (Version[0] >= 100 && !Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) {
-    CmdArgs.push_back("-demangle");
+    // Don't pass -demangle to ld_classic.
+    //
+    // FIXME: This is a temporary workaround, ld should be handling this.
+    bool UsesLdClassic = (getToolChain().getArch() == llvm::Triple::x86 &&
+                          Args.hasArg(options::OPT_static));
+    if (!UsesLdClassic)
+      CmdArgs.push_back("-demangle");
   }
 
   // Derived from the "link" spec.