Message ID | 20230219141555.2308306-4-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp868995wrn; Sun, 19 Feb 2023 06:23:54 -0800 (PST) X-Google-Smtp-Source: AK7set9MLLSWRkGgUEGBy8TpAUV24h/Q+ZeQ+P8UdkfDmmOjlOx5zfCaqlmxvx0q7lH+xoGrAR/6 X-Received: by 2002:a62:7957:0:b0:5a9:b4b4:6911 with SMTP id u84-20020a627957000000b005a9b4b46911mr561588pfc.25.1676816634121; Sun, 19 Feb 2023 06:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676816634; cv=none; d=google.com; s=arc-20160816; b=gTfcv1cPR7jaWJ9NodzSR4V952LjaS0e7/LzQO/ww3z8OnQPpJVmBNamDD5addfCXD nebT3JGNnfnsEkAE2Om88hDFtpFCF2x0ETDnl80Wnrz5T1HucqblaHTAt4iAoedcDrSZ ZtC78wS3VDs1elV9xzdm37UXEyOlTrSYZi1zvlbi19m370UzV+/K7kKn/87fBrlk5QwE +kQjfYVaKV3GOl805rDHSv5Kpl9EnC9vYM08pDlreS+lJ6os7wP9gkS0mTMYENxhuFPD A1GIKNFVDcRdYZsUOHAa7wjZ3eMwdTKsqFTIuUVwvHSoycglcCup7ThZ8uGkcf7L3lQb yEIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vF36JGKE8yBAayaGtflQgvfxpVCBHML2lqmYewT9cVg=; b=VQ6GOJZXMZVEuTVtDKiExqMWoXaBVjurR3fulUDXQs6xZF8xrCIjpukJkpJ8hmhd0u FTSVi864EFy4Iax64HhO6nck95vJm89tC5lJ09NvrkIKTv4ykW7WB7T5q9G6Ih1L53LH NzSQ96YPtaBbjBCESq4Y/9KaiPkhwrknRPPHu8eaWplFLSmyLyecBKXf4GEIvvbaoO3P VB9mbqT3HXwTCdz7kc2PgCv3JUSXgaE9veD+2fOIlCaB9hGk6GMiVS4kY1ZlNcj+2Hb7 PIU0+SB7pJzWhUAahQyr//rwQQuH4c72If/0UwUAjWy0ZXXLTbtjopdY3fCPGPy7ESw5 RKNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a6MPY1We; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n22-20020a056a0007d600b0059038315e75si10902265pfu.33.2023.02.19.06.23.41; Sun, 19 Feb 2023 06:23:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a6MPY1We; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbjBSOQf (ORCPT <rfc822;nanshango2@gmail.com> + 99 others); Sun, 19 Feb 2023 09:16:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbjBSOQ2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Feb 2023 09:16:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76F8E3AB; Sun, 19 Feb 2023 06:16:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1AA47B808BC; Sun, 19 Feb 2023 14:16:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09A25C4339B; Sun, 19 Feb 2023 14:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676816184; bh=OnHesLJjuM4ndL0bx3IO8J099WVFzKW7b0gcW6zf1HY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6MPY1We5Gq+eXc22qp3LVBeZjtQ1Z9K4zYmKOTvBgVXpowHgmidtMRl1lnjX+aHe cSwsOa/qSSgrAzai3J6hOjqO7LeJjSxQ6oT/URE6opE63Aff3BmdfC0ENb9J1rixzT PHWkYFqeV33fWe0ka3FmpdvF7j8kHwzG01HzNZDrJ0a5ednegxyLc/GpMafMluz80x g7dyQAGoHWthtQ+b7M6pDjzdEW/ekzY0vhkK6vtGsxwjILKNnG99lWS/fFhh9QUdkS cgES0y3+Bqv99Lk08ydycZp0whkYF4a4j6ajTrlIgfmiR8l/llkW/wifvURuSel9WM Kkj0Z+DaVdGqA== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Randy Dunlap <rdunlap@infradead.org>, Masahiro Yamada <masahiroy@kernel.org>, Rich Felker <dalias@libc.org>, Yoshinori Sato <ysato@users.sourceforge.jp>, linux-sh@vger.kernel.org Subject: [PATCH 4/4] sh: remove compiler flag duplication Date: Sun, 19 Feb 2023 23:15:55 +0900 Message-Id: <20230219141555.2308306-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230219141555.2308306-1-masahiroy@kernel.org> References: <20230219141555.2308306-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758269678844098136?= X-GMAIL-MSGID: =?utf-8?q?1758269678844098136?= |
Series |
[1/4] sh: fix -Wmissing-include-dirs warnings for various platforms
|
|
Commit Message
Masahiro Yamada
Feb. 19, 2023, 2:15 p.m. UTC
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>
---
arch/sh/Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
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)
On Sun, 2023-02-19 at 23:15 +0900, 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> > --- > > 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) Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
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)