Skip to content

Commit 17a2a9b

Browse files
author
H. Peter Anvin
committed
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 <rankincj@yahoo.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> LKML-Reference: <219280.97558.qm@web52907.mail.re2.yahoo.com>
1 parent 8bee738 commit 17a2a9b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎arch/x86/boot/compressed/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinu
99
KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
1010
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
1111
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
12+
cflags-$(CONFIG_X86_32) := -march=i386
1213
cflags-$(CONFIG_X86_64) := -mcmodel=small
1314
KBUILD_CFLAGS += $(cflags-y)
1415
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)

0 commit comments

Comments
 (0)