Patchwork [59/63] powerpc: uname should return ppc64le/ppcle on little endian builds

login
register
mail settings
Submitter Anton Blanchard
Date Aug. 6, 2013, 4:02 p.m.
Message ID <1375804940-22050-60-git-send-email-anton@samba.org>
Download mbox | patch
Permalink /patch/265171/
State Accepted, archived
Commit a0588015deab1844261b27a67ae6f5b910fe2830
Headers show

Comments

Anton Blanchard - Aug. 6, 2013, 4:02 p.m.
We need to distinguish between big endian and little endian
environments, so fix uname to return the right thing.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/Makefile | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 967fd23..c574a69 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -36,17 +36,26 @@  KBUILD_DEFCONFIG := ppc64_defconfig
 endif
 
 ifeq ($(CONFIG_PPC64),y)
-OLDARCH	:= ppc64
-
 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
 
 ifeq ($(new_nm),y)
 NM		:= $(NM) --synthetic
 endif
+endif
 
+ifeq ($(CONFIG_PPC64),y)
+ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+OLDARCH	:= ppc64le
+else
+OLDARCH	:= ppc64
+endif
+else
+ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+OLDARCH	:= ppcle
 else
 OLDARCH	:= ppc
 endif
+endif
 
 # It seems there are times we use this Makefile without
 # including the config file, but this replicates the old behaviour