Make Gentoo GNU GCC Config override whitespace tolerant
authorErich Keane <erich.keane@intel.com>
Fri, 14 Apr 2017 15:21:18 +0000 (15:21 +0000)
committerErich Keane <erich.keane@intel.com>
Fri, 14 Apr 2017 15:21:18 +0000 (15:21 +0000)
The config-*triple* file handling isn't tolerant of
leading/trailing whitespace, making it not terribly
obvious when a single extraneous tab/space/etc will
cause the override to be ignored. This patch simply
trims the lines to ensure that it is tolerant of
whitespace.

llvm-svn: 300328

clang/lib/Driver/ToolChains/Gnu.cpp

index 595285e..549e24c 100644 (file)
@@ -2173,6 +2173,7 @@ bool Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig(
     SmallVector<StringRef, 2> Lines;
     File.get()->getBuffer().split(Lines, "\n");
     for (StringRef Line : Lines) {
+      Line = Line.trim();
       // CURRENT=triple-version
       if (Line.consume_front("CURRENT=")) {
         const std::pair<StringRef, StringRef> ActiveVersion =