[PATCH] D24954: [ToolChains] Disable OpenSUSE rules for SLES10

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 02:27:44 PDT 2016


mgorny retitled this revision from "[ToolChains] Do not assume OpenSUSE for other SUSE variants" to "[ToolChains] Disable OpenSUSE rules for SLES10".
mgorny updated the summary for this revision.
mgorny updated this revision to Diff 72609.
mgorny added a comment.

Does this one look better for you? Yes, I know it's unsupported, that's why I don't really want to put any more effort on it than it is absolutely necessary to make clang work somehow.


https://reviews.llvm.org/D24954

Files:
  lib/Driver/ToolChains.cpp

Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -3912,8 +3912,11 @@
     return UnknownDistro;
   }
 
-  if (D.getVFS().exists("/etc/SuSE-release"))
-    return OpenSUSE;
+  File = llvm::MemoryBuffer::getFile("/etc/SuSE-release");
+  if (File)
+    return llvm::StringSwitch<Distro>(File.get()->getBuffer())
+      .StartsWith("SUSE Linux Enterprise Server 10", UnknownDistro)
+      .Default(OpenSUSE);
 
   if (D.getVFS().exists("/etc/exherbo-release"))
     return Exherbo;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24954.72609.patch
Type: text/x-patch
Size: 593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160927/46ac2c6e/attachment.bin>


More information about the cfe-commits mailing list