[PATCH 2/2] Default to i586 on openSUSE.

Johannes Obermayr johannesobermayr at gmx.de
Tue Jun 25 09:05:19 PDT 2013


---
https://build.opensuse.org/package/view_file?expand=1&file=default-to-i586.patch&package=llvm&project=devel:tools:compiler
---
 lib/Driver/Tools.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 6d468ab..4aeea6d 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1254,11 +1254,16 @@ static const char *getX86TargetCPU(const ArgList &Args,
     return "i486";
   if (Triple.getOSName().startswith("netbsd"))
     return "i486";
+
   // All x86 devices running Android have core2 as their common
-  // denominator. This makes a better choice than pentium4.
+  // denominator. This makes a better choice than i586/pentium4.
   if (Triple.getEnvironment() == llvm::Triple::Android)
     return "core2";
 
+  // Fallback to i586 on openSUSE.
+  if (llvm::sys::fs::exists("/etc/SuSE-release"))
+    return "i586";
+
   // Fallback to p4.
   return "pentium4";
 }
-- 
1.8.1.4




More information about the cfe-commits mailing list