Files
linux/scripts
Nathan Chancellor 9a6882502d 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: 454e00cf8e ("kbuild: avoid re-running compiler and linker probes")
Reported-by: Ricardo Ribalda <[email protected]>
Closes: https://lore.kernel.org/[email protected]/
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nathan Chancellor <[email protected]>
2026-10-20 14:55:40 -07:00
..
2024-10-07 02:12:27 +09:00
…
…
2026-09-26 00:16:35 +01:00
2026-09-26 00:16:35 +01:00
…
…
…
2026-01-11 06:09:11 -10:00
2026-07-27 17:18:00 +02:00
…