diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 2d3e9be229c05deac31e8d008d333065245a90fb..d7fd46479c559a2ac0c4462a8a7cb16bce5b9c30 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile @@ -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/ diff --git a/arch/x86_64/ia32/vsyscall-sigreturn.S b/arch/x86_64/ia32/vsyscall-sigreturn.S index 8b5a4b060bb56bbf65484d483a7fa5e796b1fd6c..d90321fe9bba1ffb9d23c24fef81b924a766efe0 100644 --- a/arch/x86_64/ia32/vsyscall-sigreturn.S +++ b/arch/x86_64/ia32/vsyscall-sigreturn.S @@ -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 diff --git a/arch/x86_64/ia32/vsyscall-syscall.S b/arch/x86_64/ia32/vsyscall-syscall.S index b024965bb689f55705c72770a0cec9cb632ea896..cf9ef678de3e3c68a9266bc5ab975e867b14655e 100644 --- a/arch/x86_64/ia32/vsyscall-syscall.S +++ b/arch/x86_64/ia32/vsyscall-syscall.S @@ -6,6 +6,7 @@ #include #include + .code32 .text .section .text.vsyscall,"ax" .globl __kernel_vsyscall diff --git a/arch/x86_64/ia32/vsyscall-sysenter.S b/arch/x86_64/ia32/vsyscall-sysenter.S index 71f3de586b5668a9b50ef10e05077c82438c5c55..ae056e553d1365989aef36c87fa4e898312518a3 100644 --- a/arch/x86_64/ia32/vsyscall-sysenter.S +++ b/arch/x86_64/ia32/vsyscall-sysenter.S @@ -5,6 +5,7 @@ #include #include + .code32 .text .section .text.vsyscall,"ax" .globl __kernel_vsyscall diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 4cbbe7c488391fffb7ecd765ba6c623dfde4ebf7..b0eed1faf740c582c3eb4202a70d426ec98dca4b 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S @@ -8,6 +8,8 @@ #include #include +#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)