]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Fri, 14 Nov 2025 13:43:56 +0000 (14:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:01 +0000 (14:03 +0100)
commit6394fc65d7bc3de439e6947d321b1d0917f8bda0
tree89604b0ec17850183e19f26b32c9d6b9900138a4
parent07cfb9c3f6d01a904329fd797d9a4b938b04b784
kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings

[ Upstream commit d81d9d389b9b73acd68f300c8889c7fa1acd4977 ]

It is possible that the kernel toolchain generates warnings when used
together with the system toolchain. This happens for example when the
older kernel toolchain does not handle new versions of sframe debug
information. While these warnings where ignored during the evaluation
of CC_CAN_LINK, together with CONFIG_WERROR the actual userprog build
will later fail.

Example warning:

.../x86_64-linux/13.2.0/../../../../x86_64-linux/bin/ld:
error in /lib/../lib64/crt1.o(.sframe); no .sframe will be created
collect2: error: ld returned 1 exit status

Make sure that the very simple example program does not generate
warnings already to avoid breaking the userprog compilations.

Fixes: ec4a3992bc0b ("kbuild: respect CONFIG_WERROR for linker and assembler")
Fixes: 3f0ff4cc6ffb ("kbuild: respect CONFIG_WERROR for userprogs")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20251114-kbuild-userprogs-bits-v3-1-4dee0d74d439@linutronix.de
Signed-off-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/cc-can-link.sh