]> git.itanic.dy.fi Git - linux-stable/commitdiff
x86/build: Turn off -fcf-protection for realmode targets
authorArnd Bergmann <arnd@arndb.de>
Tue, 23 Mar 2021 12:48:36 +0000 (13:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Apr 2021 11:20:11 +0000 (13:20 +0200)
[ Upstream commit 9fcb51c14da2953de585c5c6e50697b8a6e91a7b ]

The new Ubuntu GCC packages turn on -fcf-protection globally,
which causes a build failure in the x86 realmode code:

  cc1: error: ‘-fcf-protection’ is not compatible with this target

Turn it off explicitly on compilers that understand this option.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210323124846.1584944-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/Makefile

index 9f33a69b56051b2de440a9939f9c2f912382a45a..146aadeb7c8edaf4ac6eb8ac14b65cb84af2c56a 100644 (file)
@@ -35,7 +35,7 @@ REALMODE_CFLAGS       := $(M16_CFLAGS) -g -Os -D__KERNEL__ \
                   -DDISABLE_BRANCH_PROFILING \
                   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
                   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
-                  -mno-mmx -mno-sse
+                  -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none)
 
 REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
 REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)