cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
05ad79
From e10a3a201b2b4dc6ff9957600c9bf67a2f9de38e Mon Sep 17 00:00:00 2001
05ad79
From: Anton Blanchard <anton@samba.org>
05ad79
Date: Mon, 7 Apr 2014 09:18:13 +1000
05ad79
Subject: [PATCH 158/173] setarch: Fix ppc64le architectures
05ad79
05ad79
setarch currently fails on ppc64le because it tries to
05ad79
use big endian architecture names. Fix it.
05ad79
05ad79
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1562125
05ad79
Upstream: http://github.com/karelzak/util-linux/commit/95bf26fd68ec7f0b2dde1f022dc79d04d1a6e620
05ad79
Upstream: http://github.com/karelzak/util-linux/commit/e60b6df54e27cdb68a75ea8a056a70f60df8f025
05ad79
Signed-off-by: Anton Blanchard <anton@samba.org>
05ad79
Signed-off-by: Karel Zak <kzak@redhat.com>
05ad79
---
05ad79
 sys-utils/setarch.c | 8 ++++++++
05ad79
 1 file changed, 8 insertions(+)
05ad79
05ad79
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
05ad79
index 051cbefcd..b03406dd3 100644
05ad79
--- a/sys-utils/setarch.c
05ad79
+++ b/sys-utils/setarch.c
05ad79
@@ -149,11 +149,19 @@ set_arch(const char *pers, unsigned long options, int list)
05ad79
     {PER_LINUX32, "linux32", NULL},
05ad79
     {PER_LINUX, "linux64", NULL},
05ad79
 #if defined(__powerpc__) || defined(__powerpc64__)
05ad79
+#ifdef __BIG_ENDIAN__
05ad79
     {PER_LINUX32, "ppc32", "ppc"},
05ad79
     {PER_LINUX32, "ppc", "ppc"},
05ad79
     {PER_LINUX, "ppc64", "ppc64"},
05ad79
     {PER_LINUX, "ppc64pseries", "ppc64"},
05ad79
     {PER_LINUX, "ppc64iseries", "ppc64"},
05ad79
+#else
05ad79
+    {PER_LINUX32, "ppc32",  "ppcle"},
05ad79
+    {PER_LINUX32, "ppc",    "ppcle"},
05ad79
+    {PER_LINUX32, "ppc32le", "ppcle"},
05ad79
+    {PER_LINUX32, "ppcle", "ppcle"},
05ad79
+    {PER_LINUX, "ppc64le", "ppc64le"},
05ad79
+#endif
05ad79
 #endif
05ad79
 #if defined(__x86_64__) || defined(__i386__) || defined(__ia64__)
05ad79
     {PER_LINUX32, "i386", "i386"},
05ad79
-- 
05ad79
2.14.4
05ad79