From: Olaf Hering <olh@suse.de>
To: linuxppc64-dev@ozlabs.org
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] allow kernel compile with native ppc64 compiler
Date: Sun, 17 Oct 2004 20:55:57 +0200 [thread overview]
Message-ID: <20041017185557.GA9619@suse.de> (raw)
The zImage is a 32bit binary, but a native powerpc64-linux gcc will
produce 64bit objects in arch/ppc64/boot.
This patch fixes it.
Signed-off-by: Olaf Hering <olh@suse.de>
diff -purN linux-2.6.9-final/arch/ppc64/boot/Makefile linux-2.6.9-final.native/arch/ppc64/boot/Makefile
--- linux-2.6.9-final/arch/ppc64/boot/Makefile 2004-10-16 03:03:50.000000000 +0000
+++ linux-2.6.9-final.native/arch/ppc64/boot/Makefile 2004-10-17 18:44:33.229249956 +0000
@@ -23,14 +23,14 @@
CROSS32_COMPILE ?=
#CROSS32_COMPILE = /usr/local/ppc/bin/powerpc-linux-
-BOOTCC := $(CROSS32_COMPILE)gcc
+BOOTCC := $(CROSS32_COMPILE)gcc -m32
HOSTCC := gcc
BOOTCFLAGS := $(HOSTCFLAGS) $(LINUXINCLUDE) -fno-builtin
-BOOTAS := $(CROSS32_COMPILE)as
+BOOTAS := $(CROSS32_COMPILE)as -a32
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional
-BOOTLD := $(CROSS32_COMPILE)ld
+BOOTLD := $(CROSS32_COMPILE)ld -m elf32ppc
BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds
-BOOTOBJCOPY := $(CROSS32_COMPILE)objcopy
+BOOTOBJCOPY := $(CROSS32_COMPILE)objcopy --target elf32-powerpc
OBJCOPYFLAGS := contents,alloc,load,readonly,data
src-boot := crt0.S string.S prom.c main.c zlib.c imagesize.c div64.S
diff -purN linux-2.6.9-final/arch/ppc64/boot/zImage.lds linux-2.6.9-final.native/arch/ppc64/boot/zImage.lds
--- linux-2.6.9-final/arch/ppc64/boot/zImage.lds 2004-10-16 03:01:55.000000000 +0000
+++ linux-2.6.9-final.native/arch/ppc64/boot/zImage.lds 2004-10-17 18:48:14.824288338 +0000
@@ -1,4 +1,4 @@
-OUTPUT_ARCH(powerpc)
+OUTPUT_ARCH(powerpc:common)
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
/* Do we need any of these for elf?
__DYNAMIC = 0; */
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
next reply other threads:[~2004-10-17 18:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-17 18:55 Olaf Hering [this message]
2004-10-17 21:46 ` [PATCH] allow kernel compile with native ppc64 compiler Paul Mackerras
2004-10-18 4:56 ` Olaf Hering
2004-10-18 5:55 ` Paul Mackerras
2004-10-18 7:54 ` Olaf Hering
2004-10-18 10:58 ` Benjamin Herrenschmidt
[not found] <2Qoqo-Ou-41@gated-at.bofh.it>
[not found] ` <2Qr4K-2P8-15@gated-at.bofh.it>
2004-10-18 16:23 ` Andi Kleen
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=20041017185557.GA9619@suse.de \
--to=olh@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox