diff options
author | Andi Kleen <ak@suse.de> | 2006-01-11 16:43:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-11 22:04:52 -0500 |
commit | bb33421dde79f9a36d5485c56335ff178ac7d268 (patch) | |
tree | f4b8843d9295c1efb550e869352e578cb8667ce1 /arch/x86_64 | |
parent | 79c62cf1789f935280138b412bb750be84aec747 (diff) |
[PATCH] x86_64: Allow compilation on a 32bit biarch toolchain
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>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/Makefile | 3 | ||||
-rw-r--r-- | arch/x86_64/ia32/vsyscall-sigreturn.S | 1 | ||||
-rw-r--r-- | arch/x86_64/ia32/vsyscall-syscall.S | 1 | ||||
-rw-r--r-- | arch/x86_64/ia32/vsyscall-sysenter.S | 1 | ||||
-rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 2 |
5 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 2d3e9be229c0..d7fd46479c55 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile | |||
@@ -31,6 +31,7 @@ cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) | |||
31 | cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) | 31 | cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) |
32 | CFLAGS += $(cflags-y) | 32 | CFLAGS += $(cflags-y) |
33 | 33 | ||
34 | CFLAGS += -m64 | ||
34 | CFLAGS += -mno-red-zone | 35 | CFLAGS += -mno-red-zone |
35 | CFLAGS += -mcmodel=kernel | 36 | CFLAGS += -mcmodel=kernel |
36 | CFLAGS += -pipe | 37 | CFLAGS += -pipe |
@@ -52,6 +53,8 @@ CFLAGS += $(call cc-option,-funit-at-a-time) | |||
52 | # prevent gcc from generating any FP code by mistake | 53 | # prevent gcc from generating any FP code by mistake |
53 | CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) | 54 | CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) |
54 | 55 | ||
56 | AFLAGS += -m64 | ||
57 | |||
55 | head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o | 58 | head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o |
56 | 59 | ||
57 | libs-y += arch/x86_64/lib/ | 60 | libs-y += arch/x86_64/lib/ |
diff --git a/arch/x86_64/ia32/vsyscall-sigreturn.S b/arch/x86_64/ia32/vsyscall-sigreturn.S index 8b5a4b060bb5..d90321fe9bba 100644 --- a/arch/x86_64/ia32/vsyscall-sigreturn.S +++ b/arch/x86_64/ia32/vsyscall-sigreturn.S | |||
@@ -7,6 +7,7 @@ | |||
7 | * by doing ".balign 32" must match in both versions of the page. | 7 | * by doing ".balign 32" must match in both versions of the page. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | .code32 | ||
10 | .section .text.sigreturn,"ax" | 11 | .section .text.sigreturn,"ax" |
11 | .balign 32 | 12 | .balign 32 |
12 | .globl __kernel_sigreturn | 13 | .globl __kernel_sigreturn |
diff --git a/arch/x86_64/ia32/vsyscall-syscall.S b/arch/x86_64/ia32/vsyscall-syscall.S index b024965bb689..cf9ef678de3e 100644 --- a/arch/x86_64/ia32/vsyscall-syscall.S +++ b/arch/x86_64/ia32/vsyscall-syscall.S | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <asm/asm-offsets.h> | 6 | #include <asm/asm-offsets.h> |
7 | #include <asm/segment.h> | 7 | #include <asm/segment.h> |
8 | 8 | ||
9 | .code32 | ||
9 | .text | 10 | .text |
10 | .section .text.vsyscall,"ax" | 11 | .section .text.vsyscall,"ax" |
11 | .globl __kernel_vsyscall | 12 | .globl __kernel_vsyscall |
diff --git a/arch/x86_64/ia32/vsyscall-sysenter.S b/arch/x86_64/ia32/vsyscall-sysenter.S index 71f3de586b56..ae056e553d13 100644 --- a/arch/x86_64/ia32/vsyscall-sysenter.S +++ b/arch/x86_64/ia32/vsyscall-sysenter.S | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <asm/ia32_unistd.h> | 5 | #include <asm/ia32_unistd.h> |
6 | #include <asm/asm-offsets.h> | 6 | #include <asm/asm-offsets.h> |
7 | 7 | ||
8 | .code32 | ||
8 | .text | 9 | .text |
9 | .section .text.vsyscall,"ax" | 10 | .section .text.vsyscall,"ax" |
10 | .globl __kernel_vsyscall | 11 | .globl __kernel_vsyscall |
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 4cbbe7c48839..b0eed1faf740 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <asm/page.h> | 8 | #include <asm/page.h> |
9 | #include <linux/config.h> | 9 | #include <linux/config.h> |
10 | 10 | ||
11 | #undef i386 /* in case the preprocessor is a 32bit one */ | ||
12 | |||
11 | OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") | 13 | OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") |
12 | OUTPUT_ARCH(i386:x86-64) | 14 | OUTPUT_ARCH(i386:x86-64) |
13 | ENTRY(phys_startup_64) | 15 | ENTRY(phys_startup_64) |