<div dir="ltr"><div>With my openSUSE maintainer hat on.</div><div><br></div>This is OK. Can someone please apply it?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 25, 2013 at 6:05 PM, Johannes Obermayr <span dir="ltr"><<a href="mailto:johannesobermayr@gmx.de" target="_blank">johannesobermayr@gmx.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
See: <a href="https://build.opensuse.org/package/view_file?expand=1&file=assume-opensuse.patch&package=llvm&project=devel:tools:compiler" target="_blank">https://build.opensuse.org/package/view_file?expand=1&file=assume-opensuse.patch&package=llvm&project=devel:tools:compiler</a><br>


---<br>
 lib/Driver/ToolChains.cpp | 30 +++++++++++-------------------<br>
 1 file changed, 11 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp<br>
index a78370f..1bbdf2b 100644<br>
--- a/lib/Driver/ToolChains.cpp<br>
+++ b/lib/Driver/ToolChains.cpp<br>
@@ -1958,10 +1958,7 @@ enum Distro {<br>
   Fedora15,<br>
   Fedora16,<br>
   FedoraRawhide,<br>
-  OpenSuse11_3,<br>
-  OpenSuse11_4,<br>
-  OpenSuse12_1,<br>
-  OpenSuse12_2,<br>
+  OpenSUSE,<br>
   UbuntuHardy,<br>
   UbuntuIntrepid,<br>
   UbuntuJaunty,<br>
@@ -1982,8 +1979,8 @@ static bool IsRedhat(enum Distro Distro) {<br>
          (Distro >= RHEL4    && Distro <= RHEL6);<br>
 }<br>
<br>
-static bool IsOpenSuse(enum Distro Distro) {<br>
-  return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_2;<br>
+static bool IsOpenSUSE(enum Distro Distro) {<br>
+  return Distro == OpenSUSE;<br>
 }<br>
<br>
 static bool IsDebian(enum Distro Distro) {<br>
@@ -2060,13 +2057,8 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {<br>
     return UnknownDistro;<br>
   }<br>
<br>
-  if (!llvm::MemoryBuffer::getFile("/etc/SuSE-release", File))<br>
-    return llvm::StringSwitch<Distro>(File.get()->getBuffer())<br>
-      .StartsWith("openSUSE 11.3", OpenSuse11_3)<br>
-      .StartsWith("openSUSE 11.4", OpenSuse11_4)<br>
-      .StartsWith("openSUSE 12.1", OpenSuse12_1)<br>
-      .StartsWith("openSUSE 12.2", OpenSuse12_2)<br>
-      .Default(UnknownDistro);<br>
+  if (llvm::sys::fs::exists("/etc/SuSE-release"))<br>
+    return OpenSUSE;<br>
<br>
   if (llvm::sys::fs::exists("/etc/exherbo-release"))<br>
     return Exherbo;<br>
@@ -2180,7 +2172,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)<br>
   llvm::Triple::ArchType Arch = Triple.getArch();<br>
   std::string SysRoot = computeSysRoot(Args);<br>
<br>
-  // Cross-compiling binutils and GCC installations (vanilla and OpenSuse at<br>
+  // Cross-compiling binutils and GCC installations (vanilla and openSUSE at<br>
   // least) put various tools in a triple-prefixed directory off of the parent<br>
   // of the GCC installation. We use the GCC triple here to ensure that we end<br>
   // up with tools that support the same amount of cross compiling as the<br>
@@ -2196,7 +2188,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)<br>
<br>
   Distro Distro = DetectDistro(Arch);<br>
<br>
-  if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {<br>
+  if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {<br>
     ExtraOpts.push_back("-z");<br>
     ExtraOpts.push_back("relro");<br>
   }<br>
@@ -2216,11 +2208,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)<br>
   // ABI requires a mapping between the GOT and the symbol table.<br>
   // Android loader does not support .gnu.hash.<br>
   if (!IsMips && !IsAndroid) {<br>
-    if (IsRedhat(Distro) || IsOpenSuse(Distro) ||<br>
+    if (IsRedhat(Distro) || IsOpenSUSE(Distro) ||<br>
         (IsUbuntu(Distro) && Distro >= UbuntuMaverick))<br>
       ExtraOpts.push_back("--hash-style=gnu");<br>
<br>
-    if (IsDebian(Distro) || IsOpenSuse(Distro) || Distro == UbuntuLucid ||<br>
+    if (IsDebian(Distro) || IsOpenSUSE(Distro) || Distro == UbuntuLucid ||<br>
         Distro == UbuntuJaunty || Distro == UbuntuKarmic)<br>
       ExtraOpts.push_back("--hash-style=both");<br>
   }<br>
@@ -2229,12 +2221,12 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)<br>
     ExtraOpts.push_back("--no-add-needed");<br>
<br>
   if (Distro == DebianSqueeze || Distro == DebianWheezy ||<br>
-      Distro == DebianJessie || IsOpenSuse(Distro) ||<br>
+      Distro == DebianJessie || IsOpenSUSE(Distro) ||<br>
       (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||<br>
       (IsUbuntu(Distro) && Distro >= UbuntuKarmic))<br>
     ExtraOpts.push_back("--build-id");<br>
<br>
-  if (IsOpenSuse(Distro))<br>
+  if (IsOpenSUSE(Distro))<br>
     ExtraOpts.push_back("--enable-new-dtags");<br>
<br>
   // The selection of paths to try here is designed to match the patterns which<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.4<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</font></span></blockquote></div><br></div>