[PATCH] biarch gcc support for ppc32

From: Olaf Hering
Date: Sun Jul 04 2004 - 06:25:32 EST



a native powerpc64-linux gcc can not compile a ppc32 kernel properly.
This patch fixes it. It was copied from ppc64.
The change to vmlinux.lds.S fixes this error:

ld: warning: powerpc:common architecture of input file `init/built-in.o' is incompatible with powerpc:common64 output


diff -purNX /tmp/kernel_exclude.txt linux-2.6.7.orig/arch/ppc/Makefile linux-2.6.7/arch/ppc/Makefile
--- linux-2.6.7.orig/arch/ppc/Makefile 2004-07-04 08:42:32.000000000 +0000
+++ linux-2.6.7/arch/ppc/Makefile 2004-07-04 10:44:18.997644396 +0000
@@ -13,6 +13,13 @@
# This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD := $(CONFIG_KERNEL_START)

+HAS_BIARCH := $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+ifeq ($(HAS_BIARCH),y)
+AS := $(AS) -a32
+LD := $(LD) -m elf32ppc
+CC := $(CC) -m32
+endif
+
LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS += -Iarch/$(ARCH)
AFLAGS += -Iarch/$(ARCH)
diff -purNX /tmp/kernel_exclude.txt linux-2.6.7.orig/arch/ppc/kernel/vmlinux.lds.S linux-2.6.7/arch/ppc/kernel/vmlinux.lds.S
--- linux-2.6.7.orig/arch/ppc/kernel/vmlinux.lds.S 2004-06-16 05:20:26.000000000 +0000
+++ linux-2.6.7/arch/ppc/kernel/vmlinux.lds.S 2004-07-04 10:39:32.000000000 +0000
@@ -1,6 +1,6 @@
#include <asm-generic/vmlinux.lds.h>

-OUTPUT_ARCH(powerpc)
+OUTPUT_ARCH(powerpc:common)
jiffies = jiffies_64 + 4;
SECTIONS
{
--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÃRNBERG
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/