[PATCH 1/6] x86/build: Remove cc-option for GCC retpoline flags
From: Nathan Chancellor
Date: Thu Aug 14 2025 - 21:32:31 EST
The minimum supported version of GCC to build the x86 kernel was bumped
to GCC 8.1 in commit a3e8fe814ad1 ("x86/build: Raise the minimum GCC
version to 8.1"). '-mindirect-branch' and '-mindirect-branch-register'
were first supported in GCC 8.1, so there is no need to call cc-option
to inquire if it is supported.
Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=da99fd4a3ca06b43b08ba8d96dab84e83ac90aa7
Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d543c04b795f8af4ebe5b3d5f38156ef4e5734f1
Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
---
arch/x86/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 1913d342969b..ed5657395d6a 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -13,8 +13,8 @@ else
endif
ifdef CONFIG_CC_IS_GCC
-RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
-RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
+RETPOLINE_CFLAGS := -mindirect-branch=thunk-extern -mindirect-branch-register
+RETPOLINE_VDSO_CFLAGS := -mindirect-branch=thunk-inline -mindirect-branch-register
endif
ifdef CONFIG_CC_IS_CLANG
RETPOLINE_CFLAGS := -mretpoline-external-thunk
--
2.50.1