[cfe-commits] r89205 - /cfe/trunk/lib/Driver/Tools.cpp

Edward O'Callaghan eocallaghan at auroraux.org
Wed Nov 18 06:51:31 PST 2009


Author: evocallaghan
Date: Wed Nov 18 08:51:31 2009
New Revision: 89205

URL: http://llvm.org/viewvc/llvm-project?rev=89205&view=rev
Log:
Fix passing stdc++ correctly in the FreeBSD toolchain support, Credit to Roman Divacky.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=89205&r1=89204&r2=89205&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Nov 18 08:51:31 2009
@@ -2609,6 +2609,8 @@
     // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
     // the default system libraries. Just mimic this for now.
     CmdArgs.push_back("-lgcc");
+    if (D.CCCIsCXX)
+      CmdArgs.push_back("-lstdc++");
     if (Args.hasArg(options::OPT_static)) {
       CmdArgs.push_back("-lgcc_eh");
     } else {
@@ -2638,10 +2640,6 @@
     else
       CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(C, "crtendS.o")));
     CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(C, "crtn.o")));
-    // FIXME: g++ is more complicated here, it tries to put -lstdc++
-    // before -lm, for example.
-    if (D.CCCIsCXX)
-      CmdArgs.push_back("-lstdc++");
   }
 
   const char *Exec =





More information about the cfe-commits mailing list