linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] Makefile: reuse CC_VERSION_TEXT
Date: Wed, 24 Feb 2021 10:17:40 -0700	[thread overview]
Message-ID: <20210224171740.GA7180@24bbad8f3778> (raw)
In-Reply-To: <CAK7LNAQGUnzLSOHAwF6ebH7oOuNETAyf3nrdNgNNq7JsDgiFkA@mail.gmail.com>

On Wed, Feb 24, 2021 at 12:14:04PM +0900, Masahiro Yamada wrote:
> On Sat, Feb 6, 2021 at 12:46 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > On Sat, Feb 6, 2021 at 2:49 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > >
> > > On Sat, Feb 6, 2021 at 7:01 AM 'Nick Desaulniers' via Clang Built
> > > Linux <clang-built-linux@googlegroups.com> wrote:
> > > >
> > > > I noticed we're invoking $(CC) via $(shell) more than once to check the
> > > > version.  Let's reuse the first string captured in $CC_VERSION_TEXT.
> > > >
> > > > Fixes: 315bab4e972d ("kbuild: fix endless syncconfig in case arch Makefile sets CROSS_COMPILE")
> > >
> > >
> > > I did not touch this hunk because I have a plan
> > > for different refactoring, but I have never got
> > > around to do it.
> > >
> > > Anyway, you beat me, and I will pick this up.
> > > But, the Fixes tag is questionable because
> > > this is code refactoring.
> > >
> >
> > When I see this... and hear refactoring... As a suggestion/improvement...
> >
> > Can we have LD_VERSION_TEXT analogue to CC_VERSION_TEXT?
> > Both are shown when doing a `cat /proc/version` (and IIRC in file
> > include/generated/compile.h).
> 
> Sorry, I had forgotten to answer this question.
> 
> Probably, we should do so.
> 
> Feeding it to Kconfig allows us to re-evaluate
> config settings when tools are upgraded.
> 
> One question is where we should draw a line.
> If we record the version text of CC, LD,
> we should do that for more tools?
> 
> For LD, I will be probably OK because
> some features rely on LD_VERSION or $(ld-option ).
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

It probably makes sense to do this for tools that we depend on in
Kconfig, like CC and LD. Those will usually paint a good enough picture
for what tools were used on a whole since CC will tell us about the GCC
or LLVM version used (as well as distribution usually) and LD will tell
us about the binutils or LLVM version.

LTO does check $(AR) and $(NM) but it also depends on LLVM=1 LLVM_IAS=1,
which would get covered by the $(CC) and $(LD) print outs.

Cheers,
Nathan

  reply	other threads:[~2021-02-24 17:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 22:01 [PATCH] Makefile: reuse CC_VERSION_TEXT Nick Desaulniers
2021-02-06  1:48 ` Masahiro Yamada
2021-02-06  3:45   ` Sedat Dilek
2021-02-24  3:14     ` Masahiro Yamada
2021-02-24 17:17       ` Nathan Chancellor [this message]
2021-02-23 20:10   ` Nick Desaulniers
2021-02-24  2:37     ` Masahiro Yamada

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=20210224171740.GA7180@24bbad8f3778 \
    --to=nathan@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=sedat.dilek@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).