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>
 cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
 CFLAGS += $(cflags-y)
 
+CFLAGS += -m64
 CFLAGS += -mno-red-zone
 CFLAGS += -mcmodel=kernel
 CFLAGS += -pipe
 # 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/
 
  * by doing ".balign 32" must match in both versions of the page.
  */
 
+       .code32
        .section .text.sigreturn,"ax"
        .balign 32
        .globl __kernel_sigreturn
 
 #include <asm/asm-offsets.h>
 #include <asm/segment.h>
 
+       .code32
        .text
        .section .text.vsyscall,"ax"
        .globl __kernel_vsyscall
 
 #include <asm/ia32_unistd.h>
 #include <asm/asm-offsets.h>
 
+       .code32
        .text
        .section .text.vsyscall,"ax"
        .globl __kernel_vsyscall
 
 #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)