]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerNicolas Schier <nsc@kernel.org>
Fri, 14 Nov 2025 19:20:34 +0000 (20:20 +0100)
commitd81d9d389b9b73acd68f300c8889c7fa1acd4977
treeaf8bfe8d82629929ce47760049b8700368a1f215
parent7bade3f7e91969985149a66c98ef0d1d842ff464
kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings

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>
scripts/cc-can-link.sh