SUPERH platform development
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Masahiro Yamada <masahiroy@kernel.org>, linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Rich Felker <dalias@libc.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-sh@vger.kernel.org
Subject: Re: [PATCH 4/4] sh: remove compiler flag duplication
Date: Sun, 19 Feb 2023 09:05:24 -0800	[thread overview]
Message-ID: <86cc6fec-2d6e-17eb-b9ca-66c1850fca78@infradead.org> (raw)
In-Reply-To: <20230219141555.2308306-4-masahiroy@kernel.org>



On 2/19/23 06:15, Masahiro Yamada wrote:
> Every compiler flag added by arch/sh/Makefile is passed to the
> compiler twice.
> 
> $(KBUILD_CPPFLAGS) + $(KBUILD_CFLAGS) is used for compiling *.c
> $(KBUILD_CPPFLAGS) + $(KBUILD_AFLAGS) is used for compiling *.S
> 
> Given the above, adding $(cflags-y) to all of KBUILD_{CPP/C/A}FLAGS
> ends up with duplication.
> 
> Add -I options to $(KBUILD_CPPFLAGS), and the rest of $(cflags-y)
> to KBUILD_{C,A}FLAGS.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
> 
>  arch/sh/Makefile | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/sh/Makefile b/arch/sh/Makefile
> index f1c6aace8acb..cab2f9c011a8 100644
> --- a/arch/sh/Makefile
> +++ b/arch/sh/Makefile
> @@ -145,10 +145,8 @@ cpuincdir-y			+= cpu-common	# Must be last
>  
>  drivers-y			+= arch/sh/drivers/
>  
> -cflags-y	+= $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y))
> -
> +KBUILD_CPPFLAGS		+= $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y))
>  KBUILD_CFLAGS		+= -pipe $(cflags-y)
> -KBUILD_CPPFLAGS		+= $(cflags-y)
>  KBUILD_AFLAGS		+= $(cflags-y)
>  
>  ifeq ($(CONFIG_MCOUNT),y)

-- 
~Randy

  reply	other threads:[~2023-02-19 17:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 14:15 [PATCH 1/4] sh: fix -Wmissing-include-dirs warnings for various platforms Masahiro Yamada
2023-02-19 14:15 ` [PATCH 2/4] sh: move build rule of cchips/hd6446x/ to arch/sh/Kbuild Masahiro Yamada
2023-02-19 17:05   ` Randy Dunlap
2023-07-04  5:28   ` John Paul Adrian Glaubitz
2023-02-19 14:15 ` [PATCH 3/4] sh: refactor header include path addition Masahiro Yamada
2023-02-19 17:05   ` Randy Dunlap
2023-07-04  5:29   ` John Paul Adrian Glaubitz
2023-02-19 14:15 ` [PATCH 4/4] sh: remove compiler flag duplication Masahiro Yamada
2023-02-19 17:05   ` Randy Dunlap [this message]
2023-07-04  5:32   ` John Paul Adrian Glaubitz
2023-02-19 14:40 ` [PATCH 1/4] sh: fix -Wmissing-include-dirs warnings for various platforms John Paul Adrian Glaubitz
2023-02-19 16:54   ` Masahiro Yamada
2023-06-25  7:56   ` Masahiro Yamada
2023-06-25  8:11     ` John Paul Adrian Glaubitz
2023-06-25 21:07     ` John Paul Adrian Glaubitz
2023-02-19 17:05 ` Randy Dunlap
2023-07-04  5:26 ` John Paul Adrian Glaubitz
2023-07-05 17:08 ` John Paul Adrian Glaubitz

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=86cc6fec-2d6e-17eb-b9ca-66c1850fca78@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=dalias@libc.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /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