Re: [PATCH 1/2] kbuild: Move testing of '-mfentry' back to Makefile from Kconfig

From: Nathan Chancellor

Date: Mon Nov 02 2026 - 17:00:20 EST


On Fri, Oct 30, 2026 at 03:29:58PM -0700, Kees Cook wrote:
> On Tue, Oct 20, 2026 at 02:52:18PM -0700, Nathan Chancellor wrote:
> > Ricardo reported another issue with moving this check from Kbuild to
> > Kconfig, as '-mfentry' is not supported for x86_32 without '-fno-pic',
> > which affects GCC builds that are configured with PIE enabled by
> > default. arch/x86/Makefile adds '-fno-pic' to KBUILD_CFLAGS, so this
> > works properly in Kbuild.
>
> FWIW, Debian's i686-linux-gnu-gcc 16.2.0 hits this too: ARCH=i386
> allmodconfig fails at scripts/mod/empty.o with "'-pg' without '-mfentry'
> may be unreliable with shrink wrapping" under -Werror. With this patch
> on top of Linus's tree, the whole build is clean.
>
> Tested-by: Kees Cook <kees@xxxxxxxxxx>

Thanks for testing! This patch is now in 7.4-rc1, I never sent out a
thanks message:

https://git.kernel.org/linus/9a6882502d353b89fd2c82b03d9267c94684e4b2

I had applied these for testing pretty quickly and never picked up tags,
which isn't great on my part :/ but at least they will live on the
mailing list.

--
Cheers,
Nathan