dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0158-setarch-Fix-ppc64le-architectures.patch

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