All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: Andrew Morton <akpm@osdl.org>, linuxppc-dev@lists.linuxppc.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] biarch gcc support for ppc32
Date: Sun, 4 Jul 2004 13:24:20 +0200	[thread overview]
Message-ID: <20040704112420.GA13748@suse.de> (raw)


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

             reply	other threads:[~2004-07-04 11:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-04 11:24 Olaf Hering [this message]
2004-07-05 18:28 ` [PATCH] biarch gcc support for ppc32 Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040704112420.GA13748@suse.de \
    --to=olh@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.