* [PATCH] biarch gcc support for ppc32
@ 2004-07-04 11:24 Olaf Hering
2004-07-05 18:28 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Olaf Hering @ 2004-07-04 11:24 UTC (permalink / raw)
To: Andrew Morton, linuxppc-dev; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] biarch gcc support for ppc32
2004-07-04 11:24 [PATCH] biarch gcc support for ppc32 Olaf Hering
@ 2004-07-05 18:28 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2004-07-05 18:28 UTC (permalink / raw)
To: Olaf Hering; +Cc: Andrew Morton, linuxppc-dev, linux-kernel
On Sun, Jul 04, 2004 at 01:24:20PM +0200, Olaf Hering wrote:
>
> 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:
Have all of these changes been tested with a ppc32 compiler as well?
If so, this looks fine.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-05 18:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-04 11:24 [PATCH] biarch gcc support for ppc32 Olaf Hering
2004-07-05 18:28 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox