public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	 kernel-team@cloudflare.com,
	Nathan Chancellor <nathan@kernel.org>,
	 Nicolas Schier <nsc@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH v1] kbuild: Fix CC_CAN_LINK detection
Date: Thu, 12 Feb 2026 15:50:58 +0100	[thread overview]
Message-ID: <20260212.Eich4Liesaiv@digikod.net> (raw)
In-Reply-To: <20260212151347-6f19b408-f22b-4ecb-9ce5-bd4e01e06743@linutronix.de>

On Thu, Feb 12, 2026 at 03:15:47PM +0100, Thomas Weißschuh wrote:
> 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@kernel.org>
> > Cc: Nicolas Schier <nsc@kernel.org>
> > Cc: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > Cc: stable@vger.kernel.org
> > Fixes: d81d9d389b9b ("kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings")
> 
> Thanks!
> 
> Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> 
> In my GCC 15.2 this warning is not enabled by default.

Some for me, but it is the case with GCC 13.3.0 on Ubuntu 24 LTS.

> 
> > Signed-off-by: Mickaël Salaün <mic@digikod.net>
> > ---
> >  scripts/cc-can-link.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/scripts/cc-can-link.sh b/scripts/cc-can-link.sh
> > index e67fd8d7b684..58dc7dd6d556 100755
> > --- a/scripts/cc-can-link.sh
> > +++ b/scripts/cc-can-link.sh
> > @@ -5,7 +5,7 @@ cat << "END" | $@ -Werror -Wl,--fatal-warnings -x c - -o /dev/null >/dev/null 2>
> >  #include <stdio.h>
> >  int main(void)
> >  {
> > -	printf("");
> > +	printf("\n");
> >  	return 0;
> >  }
> >  END
> > -- 
> > 2.53.0
> > 

  reply	other threads:[~2026-02-12 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 13:35 [PATCH v1] kbuild: Fix CC_CAN_LINK detection Mickaël Salaün
2026-02-12 14:15 ` Thomas Weißschuh
2026-02-12 14:50   ` Mickaël Salaün [this message]
2026-02-13 16:29 ` Nicolas Schier
2026-02-18 20:49 ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260212.Eich4Liesaiv@digikod.net \
    --to=mic@digikod.net \
    --cc=kernel-team@cloudflare.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox