http://llvm.org/bugs/show_bug.cgi?id=7997

The option -ccc-cxx is supposed to make Clang "Act as a C++ driver",
even if it's not called from a clang++-2.8 symlink, but it only
actually does that on darwin, auroraux, openbsd, freebsd, minix, and
dragonfly (the platforms with Link::ConstructJob methods in
lib/Driver/Tools.cpp). The attached patch makes it work on Linux, too
(since the point of CCCGenericGCCName is to be the executable called
for linking/etc in gcc::Common::ConstructJob in lib/Driver/Tools.cpp).
Index: tools/driver/driver.cpp
===================================================================
--- tools/driver/driver.cpp	(revision 111771)
+++ tools/driver/driver.cpp	(working copy)
@@ -334,7 +334,6 @@
   if (llvm::StringRef(ProgName).endswith("++") ||
       llvm::StringRef(ProgName).rsplit('-').first.endswith("++")) {
     TheDriver.CCCIsCXX = true;
-    TheDriver.CCCGenericGCCName = "g++";
   }
 
   // Handle CC_PRINT_OPTIONS and CC_PRINT_OPTIONS_FILE.
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp	(revision 111771)
+++ lib/Driver/Driver.cpp	(working copy)
@@ -205,6 +205,8 @@
   CCCPrintActions = Args->hasArg(options::OPT_ccc_print_phases);
   CCCPrintBindings = Args->hasArg(options::OPT_ccc_print_bindings);
   CCCIsCXX = Args->hasArg(options::OPT_ccc_cxx) || CCCIsCXX;
+  if (CCCIsCXX)
+    CCCGenericGCCName = "g++";
   CCCEcho = Args->hasArg(options::OPT_ccc_echo);
   if (const Arg *A = Args->getLastArg(options::OPT_ccc_gcc_name))
     CCCGenericGCCName = A->getValue(*Args);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to