[cfe-commits] r141121 - /cfe/trunk/lib/Driver/ToolChains.cpp

Chandler Carruth chandlerc at gmail.com
Tue Oct 4 14:22:42 PDT 2011


Author: chandlerc
Date: Tue Oct  4 16:22:42 2011
New Revision: 141121

URL: http://llvm.org/viewvc/llvm-project?rev=141121&view=rev
Log:
Now that multiple prefixes are much cheaper to search for GCC
installations, support them when installed directly under the system
root ('/lib/gcc/...' essentially).

With this, Clang can correctly detect and use a cross-compiling GCC
installation within a system root and use it.

Again, test cases will be coming in later commits, as I'm going to write
a few test cases that exercise nearly all of this logic.

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

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=141121&r1=141120&r2=141121&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Oct  4 16:22:42 2011
@@ -1639,6 +1639,7 @@
     // Compute the set of prefixes for our search.
     SmallVector<std::string, 8> Prefixes(D.PrefixDirs.begin(),
                                          D.PrefixDirs.end());
+    Prefixes.push_back(D.SysRoot);
     Prefixes.push_back(D.SysRoot + "/usr");
 
     // Loop over the various components which exist and select the best GCC





More information about the cfe-commits mailing list