biarch gcc support for ppc32
PATCH 1/1 biarch gcc support for ppc32
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
arch/ppc/Makefile +7 -0
@@ -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)
arch/ppc/kernel/vmlinux.lds.S +1 -1
@@ -1,6 +1,6 @@ #include <asm-generic/vmlinux.lds.h> -OUTPUT_ARCH(powerpc) +OUTPUT_ARCH(powerpc:common) jiffies = jiffies_64 + 4; SECTIONS {
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 4 lines · Olaf Hering
a native powerpc64-linux gcc can not compile a ppc32 kernel properly. This patch fixes it. It was copied from ppc64.
The change tovmlinux.lds.Sfixes this error:
Have all of these changes been tested with a ppc32 compiler as well? If so, this looks fine.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/