From bcf1da8ff6ab007a23a8d1be8e950d92cee4241e Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 7 Sep 2010 17:07:49 +0000 Subject: [PATCH] Driver/Darwin: Don't pass -demangle to the linker when we know it is going to 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index a055904a89..0215cdfa61 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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. -- 2.40.0