[PATCH] ppc64 & powerpc: Check whether the native CC can use -m64

Daniel Ostrow dostrow at gentoo.org
Wed Nov 9 06:14:04 EST 2005


This patch is taken from the arch/sparc64/Makefile almost verbatim. It
is really only useful when one is running a pure 32-bit userland (using
the powerpc toolchain instead of the powerpc64 one) under a 64-bit
kernel. It just checks to make sure that the native CC can use -m64 and
if it can't resets CC to the powerpc64 gcc.

Signed-off-by: Daniel Ostrow <dostrow at gentoo.org>

-- 
Daniel Ostrow
Gentoo Foundation Board of Trustees
Gentoo/{PPC,PPC64,DevRel}
dostrow at gentoo.org

diff -Naupr powerpc-merge.orig/arch/powerpc/Makefile
powerpc-merge/arch/powerpc/Makefile
--- powerpc-merge.orig/arch/powerpc/Makefile	2005-11-08
10:18:18.000000000 -0800
+++ powerpc-merge/arch/powerpc/Makefile	2005-11-08 10:20:27.000000000
-0800
@@ -17,6 +17,7 @@ HAS_BIARCH	:= $(call cc-option-yn, -m32)
 ifeq ($(CONFIG_PPC64),y)
 OLDARCH	:= ppc64
 SZ	:= 64
+CC	:= $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null
2>&1; then echo $(CC); else echo powerpc64-linux-gcc; fi )
 
 # Set default 32 bits cross compilers for vdso and boot wrapper
 CROSS32_COMPILE ?=
diff -Naupr powerpc-merge.orig/arch/ppc64/Makefile
powerpc-merge/arch/ppc64/Makefile
--- powerpc-merge.orig/arch/ppc64/Makefile	2005-11-08 10:07:06.000000000
-0800
+++ powerpc-merge/arch/ppc64/Makefile	2005-11-08 10:56:56.000000000
-0800
@@ -14,6 +14,7 @@
 #
 
 KERNELLOAD	:= 0xc000000000000000
+CC		:= $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null
2>&1; then echo $(CC); else echo powerpc64-linux-gcc; fi )
 
 # Set default 32 bits cross compilers for vdso and boot wrapper
 CROSS32_COMPILE ?=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20051108/dadcd07d/attachment.htm 


More information about the Linuxppc64-dev mailing list