Re: [PATCH v1] kbuild: Fix CC_CAN_LINK detection
From: Nicolas Schier
Date: Fri Feb 13 2026 - 11:32:25 EST
On Thu, Feb 12, 2026 at 02:35:43PM +0100, Mickaël Salaün wrote:
> Most samples cannot be build on some environments because they depend
> on CC_CAN_LINK, which is set according to the result of
> scripts/cc-can-link.sh called by cc_can_link_user.
>
> Because cc-can-link.sh must now build without warning, it may fail
> because it is calling printf() with an empty string:
>
> + cat
> + gcc -m32 -Werror -Wl,--fatal-warnings -x c - -o /dev/null
> <stdin>: In function ‘main’:
> <stdin>:4:9: error: zero-length gnu_printf format string [-Werror=format-zero-length]
> cc1: all warnings being treated as errors
>
> Fix this warning and the samples build by actually printing something.
>
> Cc: Nathan Chancellor <nathan@xxxxxxxxxx>
> Cc: Nicolas Schier <nsc@xxxxxxxxxx>
> Cc: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: d81d9d389b9b ("kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings")
> Signed-off-by: Mickaël Salaün <mic@xxxxxxxxxxx>
> ---
> scripts/cc-can-link.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks!
Reviewed-by: Nicolas Schier <nsc@xxxxxxxxxx>