Index: lib/Driver/ToolChains.cpp =================================================================== --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -3931,8 +3931,26 @@ .Default(UnknownDistro); } - if (VFS.exists("/etc/SuSE-release")) - return OpenSUSE; + File = VFS.getBufferForFile("/etc/SuSE-release"); + if (File) { + StringRef Data = File.get()->getBuffer(); + SmallVector Lines; + Data.split(Lines, "\n"); + for (const StringRef& Line : Lines) { + std::pair SplitLine = Line.split('='); + int Version; + if (SplitLine.first.trim() == "VERSION" && + !SplitLine.second.trim().getAsInteger(10, Version)) { + // OpenSUSE/SLES 10 and older are not supported and not compatible + // with our rules, so just treat them as UnknownDistro. + if (Version > 10) + return OpenSUSE; + else + return UnknownDistro; + } + } + return UnknownDistro; + } if (VFS.exists("/etc/exherbo-release")) return Exherbo;