linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-m68k <linux-m68k@lists.linux-m68k.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y
Date: Mon, 29 Jun 2020 19:47:17 +0200	[thread overview]
Message-ID: <CAMuHMdV4rvhJW2BTdxLwvVkpkRobOcTY5srEX-CR8whhnEuZ5g@mail.gmail.com> (raw)
In-Reply-To: <20200526123810.301667-3-masahiroy@kernel.org>

On Tue, May 26, 2020 at 2:38 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> arch/m68k/Makefile computes lots of unneeded cc-option calls.
>
> For example, if CONFIG_M5441x is not defined, there is not point in
> evaluating the following compiler flag.
>
>  cpuflags-$(CONFIG_M5441x)      := $(call cc-option,-mcpu=54455,-mcfv4e)
>
> The result is set to cpuflags-, then thrown away.
>
> The right hand side of ':=' is immediately expanded. Hence, all of the
> 16 calls for cc-option are evaluated. This is expensive since cc-option
> invokes the compiler. This occurs even if you are not attempting to
> build anything, like 'make ARCH=m68k help'.
>
> Use '=' to expand the value _lazily_. The evaluation for cc-option is
> delayed until $(cpuflags-y) is expanded. So, the cc-option test happens
> just once at most.
>
> This commit mimics tune-y of arch/arm/Makefile.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2020-06-29 19:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
2020-05-26 12:38 ` [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3 Masahiro Yamada
2020-06-29 17:46   ` Geert Uytterhoeven
2020-05-26 12:38 ` [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y Masahiro Yamada
2020-05-27 12:55   ` Greg Ungerer
2020-06-29 17:47   ` Geert Uytterhoeven [this message]
2020-05-26 12:38 ` [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS Masahiro Yamada
2020-05-27 13:00   ` Greg Ungerer
2020-06-29 17:47   ` Geert Uytterhoeven
2020-05-27 13:04 ` [PATCH 1/4] m68k: add arch/m68k/Kbuild Greg Ungerer
2020-06-29 17:35 ` Geert Uytterhoeven

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=CAMuHMdV4rvhJW2BTdxLwvVkpkRobOcTY5srEX-CR8whhnEuZ5g@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=masahiroy@kernel.org \
    /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).