From: Daniel Dunbar Date: Wed, 8 Apr 2009 06:06:21 +0000 (+0000) Subject: Darwin ld: Unconditionally add -lstdc++ if we are pretending to be X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edfa02b85b186e9ea9e0c841539a77ed32ee9148;p=clang Darwin ld: Unconditionally add -lstdc++ if we are pretending to be g++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68601 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 4ae96c2e64..487e5c8cd0 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1481,6 +1481,11 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA, if (!Args.hasArg(options::OPT_nostdlib) && !Args.hasArg(options::OPT_nodefaultlibs)) { + // FIXME: g++ is more complicated here, it tries to put -lstdc++ + // before -lm, for example. + if (getToolChain().getHost().getDriver().CCCIsCXX) + CmdArgs.push_back("-lstdc++"); + // link_ssp spec is empty. // Derived from libgcc and lib specs but refactored.