public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] Kbuild: move extra gcc check flags to the top Makefile
Date: Tue, 08 Apr 2014 17:06:57 +0200	[thread overview]
Message-ID: <53441091.2060706@suse.cz> (raw)
In-Reply-To: <1396840939-24512-1-git-send-email-yamada.m@jp.panasonic.com>

On 2014-04-07 05:22, Masahiro Yamada wrote:
> If W=... given to the command line, extra gcc check flags are added
> to KBUILD_CFLAGS.
> 
> If we have such code in scripts/Makefile.build, the same flags are
> added to KBUILD_CFLAGS multiple times becuase scripts/Makefile.build
> is invoked every time Kbuild descends into the subdirectories.

Indeed. For three years, nobody has noticed that the gcc commandline is
growing with every subdirectory.

> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
>  Makefile               | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  scripts/Makefile.build | 51 --------------------------------------------------
>  2 files changed, 51 insertions(+), 51 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 00a933b..6588a03 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -579,6 +579,57 @@ endif # $(dot-config)
>  # Defaults to vmlinux, but the arch makefile usually adds further targets
>  all: vmlinux
>  
> +#
> +# make W=... settings

I don't think it's a good idea to add this to the main Makefile. First
of all, this option

> +warning-1 += $(call cc-option, -Wunused-but-set-variable)

gets overridden by

KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)

couple of lines later. This is easily fixed by moving the whole block
down. However, the main Makefile is quite complex already, so please
move this to a new Makefile fragment in scripts/ and include this from
the main Makefile instead.

Thanks,
Michal

  reply	other threads:[~2014-04-08 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07  3:22 [PATCH] Kbuild: move extra gcc check flags to the top Makefile Masahiro Yamada
2014-04-08 15:06 ` Michal Marek [this message]
2014-04-08 15:18   ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2013-12-18  5:53 [PATCH] Kbuild: Move " 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=53441091.2060706@suse.cz \
    --to=mmarek@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yamada.m@jp.panasonic.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