From: Kees Cook Date: Sat, 8 Mar 2025 04:29:25 +0000 (-0800) Subject: x86/build: Remove -ffreestanding on i386 with GCC X-Git-Tag: v6.15-rc1~233^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16cb16e0d28501f6eef7071675f1ffbceea8dd0d;p=thirdparty%2Fkernel%2Flinux.git x86/build: Remove -ffreestanding on i386 with GCC The use of -ffreestanding is a leftover that is only needed for certain versions of Clang. Adjust this to be Clang-only. A later patch will make this a versioned check. Acked-by: Ingo Molnar Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20250308042929.1753543-1-kees@kernel.org Signed-off-by: Kees Cook --- diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 5b773b34768d1..4c136bcaff861 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -137,8 +137,10 @@ ifeq ($(CONFIG_X86_32),y) include $(srctree)/arch/x86/Makefile_32.cpu KBUILD_CFLAGS += $(cflags-y) - # temporary until string.h is fixed + ifeq ($(CONFIG_CC_IS_CLANG),y) + # https://github.com/llvm/llvm-project/issues/53645 KBUILD_CFLAGS += -ffreestanding + endif ifeq ($(CONFIG_STACKPROTECTOR),y) ifeq ($(CONFIG_SMP),y)