]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/build: Drop unnecessary '-ffreestanding' addition to KBUILD_CFLAGS
authorNathan Chancellor <nathan@kernel.org>
Sun, 17 May 2026 23:05:14 +0000 (13:05 -1000)
committerNathan Chancellor <nathan@kernel.org>
Wed, 27 May 2026 22:20:05 +0000 (15:20 -0700)
Now that the minimum supported version of LLVM for building the kernel
has been raised to 17.0.1, the addition of '-ffreestanding' to
KBUILD_CFLAGS for 32-bit x86 is unnecessary, as the linked LLVM bug is
resolved in all supported LLVM versions.

  16cb16e0d285 ("x86/build: Remove -ffreestanding on i386 with GCC")

intended to make the addition of '-ffreestanding' clang only but due to
a bug in the adjusted check from

  d70da12453ac ("hardening: Enable i386 FORTIFY_SOURCE on Clang 16+")

it has been applied for all versions of GCC and clang < 16.0.0. There
are no known problems with removing this for GCC but if one surfaces, it
can be restored under a CONFIG_CC_IS_GCC block.

Link: https://patch.msgid.link/20260517-bump-minimum-supported-llvm-version-to-17-v2-11-b3b8cda46bdd@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
arch/x86/Makefile

index 46fec0b08487abf931bba0aa5e1d7d8b0a49f011..5720f2470cfcae07415f9e348bef502b66651012 100644 (file)
@@ -124,11 +124,6 @@ ifeq ($(CONFIG_X86_32),y)
         include $(srctree)/arch/x86/Makefile_32.cpu
         KBUILD_CFLAGS += $(cflags-y)
 
-    ifneq ($(call clang-min-version, 160000),y)
-        # https://github.com/llvm/llvm-project/issues/53645
-        KBUILD_CFLAGS += -ffreestanding
-    endif
-
         percpu_seg := fs
 else
         BITS := 64