Thread (8 messages) 8 messages, 4 authors, 2021-02-08

Re: PROBLEM: 5.11.0-rc7 fails to compile with error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible

From: AC <hidden>
Date: 2021-02-08 16:59:41
Also in: lkml

That did fix it, thank you!

On February 8, 2021 7:12:27 AM EST, Borislav Petkov [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Sun, Feb 07, 2021 at 07:40:32PM -0500, Stuart Little wrote:
quoted
quoted
On Sun, Feb 07, 2021 at 06:31:22PM -0500, Stuart Little wrote:
quoted
I am trying to compile on an x86_64 host for a 32-bit system; my
config is at
quoted
quoted
quoted
https://termbin.com/v8jl

I am getting numerous errors of the form

./include/linux/kasan-checks.h:17:1: error: ‘-mindirect-branch’
and ‘-fcf-protection’ are not compatible

Does this fix it?

---
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 5857917f83ee..30920d70b48b 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -50,6 +50,9 @@ export BITS
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
KBUILD_CFLAGS += $(call cc-option,-mno-avx,)

+# Intel CET isn't enabled in the kernel
+KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
+
ifeq ($(CONFIG_X86_32),y)
        BITS := 32
        UTS_MACHINE := i386
@@ -120,9 +123,6 @@ else

        KBUILD_CFLAGS += -mno-red-zone
        KBUILD_CFLAGS += -mcmodel=kernel
-
-	# Intel CET isn't enabled in the kernel
-	KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
endif

ifdef CONFIG_X86_X32
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help