[lkml]   [2009]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip:x86/urgent] x86, compress: Force i386 instructions for the decompressor
Commit-ID:  17a2a9b57a9a7d2fd8f97df951b5e63e0bd56ef5
Author: H. Peter Anvin <>
AuthorDate: Fri, 25 Dec 2009 15:40:38 -0800
Committer: H. Peter Anvin <>
CommitDate: Fri, 25 Dec 2009 15:40:38 -0800

x86, compress: Force i386 instructions for the decompressor

Recently, some distros have started shipping versions of gcc which
default to -march=i686. This breaks building kernels for pre-i686
machines, even if they have been selected in Kconfig, due to the
generation of CMOV instructions.

There isn't enough benefit to try to preserve the generation of these
instructions even when selected, so simply force -march=i386 for the
decompressor when building a 32-bit kernel.

Reported-and-tested-by: Chris Rankin <>
Signed-off-by: H. Peter Anvin <>
LKML-Reference: <>
arch/x86/boot/compressed/Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index f8ed065..f25bbd3 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -9,6 +9,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinu
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
+cflags-$(CONFIG_X86_32) := -march=i386
cflags-$(CONFIG_X86_64) := -mcmodel=small
KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)

 \ /
  Last update: 2009-12-26 01:51    [W:0.041 / U:3.564 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site