linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Nathan Chancellor <nathan@kernel.org>,
	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 11:37:18 +0900	[thread overview]
Message-ID: <CAK7LNAQ_4=xaZ71nE5T8V2vEV_7zrEWMrv6n2aRog-sqxjiTLw@mail.gmail.com> (raw)
In-Reply-To: <CAKwvOd=qh0=tU9fr60DxcJepUfg6+BkqScwifW4s8A2A=ofKpw@mail.gmail.com>

On Wed, Feb 24, 2021 at 5:10 AM 'Nick Desaulniers' via Clang Built
Linux <clang-built-linux@googlegroups.com> wrote:
>
> On Fri, Feb 5, 2021 at 5:49 PM 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.
>
> Hi Masahiro,
> A friendly reminder to please pick this up; I don't see it yet in
> linux-next. I'm ok with you dropping the fixes tag when applied.


Sorry, I had completely forgotten to do this.
Thanks for the reminder.

I inserted this before Nathan's "remove # characters" patch.




> (Otherwise, I was about to use `grep -m1` instead of `| head -n1 | grep` here.)
>
> >
> >
> >
> >
> > > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> > > ---
> > >  Makefile | 14 +++++++-------
> > >  1 file changed, 7 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index a85535eb6a7d..70034d7c1051 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -557,7 +557,13 @@ ifdef building_out_of_srctree
> > >         { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
> > >  endif
> > >
> > > -ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
> > > +# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
> > > +# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
> > > +# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
> > > +# and from include/config/auto.conf.cmd to detect the compiler upgrade.
> > > +CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
> > > +
> > > +ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)
> > >  ifneq ($(CROSS_COMPILE),)
> > >  CLANG_FLAGS    += --target=$(notdir $(CROSS_COMPILE:%-=%))
> > >  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
> > > @@ -576,12 +582,6 @@ KBUILD_AFLAGS      += $(CLANG_FLAGS)
> > >  export CLANG_FLAGS
> > >  endif
> > >
> > > -# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
> > > -# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
> > > -# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
> > > -# and from include/config/auto.conf.cmd to detect the compiler upgrade.
> > > -CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
> > > -
> > >  ifdef config-build
> > >  # ===========================================================================
> > >  # *config targets only - make sure prerequisites are updated, and descend
> > > --
>
>
> --
> Thanks,
> ~Nick Desaulniers
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/CAKwvOd%3Dqh0%3DtU9fr60DxcJepUfg6%2BBkqScwifW4s8A2A%3DofKpw%40mail.gmail.com.



-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2021-02-24  2:38 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
2021-02-23 20:10   ` Nick Desaulniers
2021-02-24  2:37     ` Masahiro Yamada [this message]

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='CAK7LNAQ_4=xaZ71nE5T8V2vEV_7zrEWMrv6n2aRog-sqxjiTLw@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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).