]> granicus.if.org Git - clang/commitdiff
Darwin ld: Unconditionally add -lstdc++ if we are pretending to be
authorDaniel Dunbar <daniel@zuster.org>
Wed, 8 Apr 2009 06:06:21 +0000 (06:06 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 8 Apr 2009 06:06:21 +0000 (06:06 +0000)
g++.

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

lib/Driver/Tools.cpp

index 4ae96c2e6433c5dfc1427679afc89adb3ca5d186..487e5c8cd05c79cf39b8c9b8abe88e9a6eddfe1b 100644 (file)
@@ -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.