Blob Blame History Raw
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 23 Mar 2021 13:48:36 +0100
Subject: x86/build: Turn off -fcf-protection for realmode targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 9fcb51c14da2953de585c5c6e50697b8a6e91a7b
Patch-mainline: v5.12-rc5
References: git-fixes

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

Acked-by: Nikolay Borisov <nik.borisov@suse.com>
---
 arch/x86/Makefile |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -25,6 +25,7 @@ REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os
 		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
 		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
 		   -mno-mmx -mno-sse \
+		   $(call cc-option,-fcf-protection=none) \
 		   $(call cc-option, -ffreestanding) \
 		   $(call cc-option, -fno-stack-protector) \
 		   $(call cc-option, -mpreferred-stack-boundary=2)