]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] x86_64: Allow compilation on a 32bit biarch toolchain
authorAndi Kleen <ak@suse.de>
Wed, 11 Jan 2006 21:43:54 +0000 (22:43 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 03:04:52 +0000 (19:04 -0800)
This might help on distributions that use a 32bit biarch compiler.

First pass -m64 by default.

Secondly add some more .code32s because at least the Ubuntu biarch
32bit as called by gcc doesn't seem to handle -m64 -m32 as generated
by the Makefile without such assistance.

And finally make sure the linker script can be preprocessed
with a 32bit cpp.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/Makefile
arch/x86_64/ia32/vsyscall-sigreturn.S
arch/x86_64/ia32/vsyscall-syscall.S
arch/x86_64/ia32/vsyscall-sysenter.S
arch/x86_64/kernel/vmlinux.lds.S

index 2d3e9be229c05deac31e8d008d333065245a90fb..d7fd46479c559a2ac0c4462a8a7cb16bce5b9c30 100644 (file)
@@ -31,6 +31,7 @@ cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
 cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
 CFLAGS += $(cflags-y)
 
+CFLAGS += -m64
 CFLAGS += -mno-red-zone
 CFLAGS += -mcmodel=kernel
 CFLAGS += -pipe
@@ -52,6 +53,8 @@ CFLAGS += $(call cc-option,-funit-at-a-time)
 # prevent gcc from generating any FP code by mistake
 CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
 
+AFLAGS += -m64
+
 head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
 
 libs-y                                         += arch/x86_64/lib/
index 8b5a4b060bb56bbf65484d483a7fa5e796b1fd6c..d90321fe9bba1ffb9d23c24fef81b924a766efe0 100644 (file)
@@ -7,6 +7,7 @@
  * by doing ".balign 32" must match in both versions of the page.
  */
 
+       .code32
        .section .text.sigreturn,"ax"
        .balign 32
        .globl __kernel_sigreturn
index b024965bb689f55705c72770a0cec9cb632ea896..cf9ef678de3e3c68a9266bc5ab975e867b14655e 100644 (file)
@@ -6,6 +6,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/segment.h>
 
+       .code32
        .text
        .section .text.vsyscall,"ax"
        .globl __kernel_vsyscall
index 71f3de586b5668a9b50ef10e05077c82438c5c55..ae056e553d1365989aef36c87fa4e898312518a3 100644 (file)
@@ -5,6 +5,7 @@
 #include <asm/ia32_unistd.h>
 #include <asm/asm-offsets.h>
 
+       .code32
        .text
        .section .text.vsyscall,"ax"
        .globl __kernel_vsyscall
index 4cbbe7c488391fffb7ecd765ba6c623dfde4ebf7..b0eed1faf740c582c3eb4202a70d426ec98dca4b 100644 (file)
@@ -8,6 +8,8 @@
 #include <asm/page.h>
 #include <linux/config.h>
 
+#undef i386    /* in case the preprocessor is a 32bit one */
+
 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
 OUTPUT_ARCH(i386:x86-64)
 ENTRY(phys_startup_64)