<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.6.2">
</HEAD>
<BODY>
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.<BR>
<BR>
Signed-off-by: Daniel Ostrow &lt;<A HREF="mailto:dostrow@gentoo.org">dostrow@gentoo.org</A>&gt;<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Daniel Ostrow<BR>
Gentoo Foundation Board of Trustees<BR>
Gentoo/{PPC,PPC64,DevRel}<BR>
<A HREF="mailto:dostrow@gentoo.org">dostrow@gentoo.org</A>
</TD>
</TR>
</TABLE>
<BR>
diff -Naupr powerpc-merge.orig/arch/powerpc/Makefile powerpc-merge/arch/powerpc/Makefile<BR>
--- powerpc-merge.orig/arch/powerpc/Makefile        2005-11-08 10:18:18.000000000 -0800<BR>
+++ powerpc-merge/arch/powerpc/Makefile        2005-11-08 10:20:27.000000000 -0800<BR>
@@ -17,6 +17,7 @@ HAS_BIARCH        := $(call cc-option-yn, -m32)<BR>
 ifeq ($(CONFIG_PPC64),y)<BR>
 OLDARCH        := ppc64<BR>
 SZ        := 64<BR>
+CC        := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null &gt;/dev/null 2&gt;&amp;1; then echo $(CC); else echo powerpc64-linux-gcc; fi )<BR>
 <BR>
 # Set default 32 bits cross compilers for vdso and boot wrapper<BR>
 CROSS32_COMPILE ?=<BR>
diff -Naupr powerpc-merge.orig/arch/ppc64/Makefile powerpc-merge/arch/ppc64/Makefile<BR>
--- powerpc-merge.orig/arch/ppc64/Makefile        2005-11-08 10:07:06.000000000 -0800<BR>
+++ powerpc-merge/arch/ppc64/Makefile        2005-11-08 10:56:56.000000000 -0800<BR>
@@ -14,6 +14,7 @@<BR>
 #<BR>
 <BR>
 KERNELLOAD        := 0xc000000000000000<BR>
+CC                := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null &gt;/dev/null 2&gt;&amp;1; then echo $(CC); else echo powerpc64-linux-gcc; fi )<BR>
 <BR>
 # Set default 32 bits cross compilers for vdso and boot wrapper<BR>
 CROSS32_COMPILE ?=
</BODY>
</HTML>