diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-10-20 14:52:18 -0700 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-10-20 14:55:40 -0700 |
| commit | 9a6882502d353b89fd2c82b03d9267c94684e4b2 (patch) | |
| tree | dbbbdccb3031e9af02605269a396f66ca1a2458e /scripts/stackusage | |
| parent | 997208ce9f43f01febac956cf9aeffe89945e3c1 (diff) | |
| download | linux-9a6882502d353b89fd2c82b03d9267c94684e4b2.tar.gz linux-9a6882502d353b89fd2c82b03d9267c94684e4b2.zip | |
kbuild: Move testing of '-mfentry' back to Makefile from Kconfig
Unlike cc-option in Kbuild, cc-option in Kconfig does not test options
with either bit ('-m32' / '-m64') or endianness ('-mbig-endian' /
'-mlittle-endian') flags because which flag to use may depend on the
result of the configuration stage. This difference changes the result of
testing for '-mfentry' support when using the kernel.org s390 cross
compiler, which is configured for 32-bit by default.
$ s390-linux-gcc -mfentry -o /dev/null -x c -c /dev/null
cc1: error: '-mfentry' is supported only for 64-bit CPUs
arch/s390/Makefile sets '-m64' in KBUILD_CPPFLAGS early, so '-mfentry'
support was properly tested before the move to Kconfig.
$ s390-linux-gcc -m64 -mfentry -o /dev/null -x c -c /dev/null
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.
Move the '-mfentry' check back into Kbuild to avoid adding additional
complexity to the Kconfig entry.
Fixes: 454e00cf8ee5 ("kbuild: avoid re-running compiler and linker probes")
Reported-by: Ricardo Ribalda <ribalda@chromium.org>
Closes: https://lore.kernel.org/20261020-pie-v1-1-9be09f2324b1@chromium.org/
Link: https://patch.msgid.link/20261020-kconfig-fix-mfentry-check-v1-1-428258bc0fc0@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
