Message ID | 20221118191551.66448-2-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp370808wrr; Fri, 18 Nov 2022 11:28:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf4nCOS1yeVTkjnhK/eb7eEEkQQQ3ydVtYRjZhOu/z5UZOJyDy2KeKzR3Qgp6ep4u9i+E38X X-Received: by 2002:a17:90b:2801:b0:200:2069:7702 with SMTP id qb1-20020a17090b280100b0020020697702mr9296736pjb.239.1668799698201; Fri, 18 Nov 2022 11:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668799698; cv=none; d=google.com; s=arc-20160816; b=ORV0BVxr7523NBo9qNlH7MfKURVKE+PwCCuUfo2eDPTikCo98sFy6k/vSlHmv7fXM5 F4sRLjpzcy6vntfFM6GEQnNXgjK5T7xdg0PRKSPkDba/3OxioWAHpmN3UrrLjteGXVAt fC4KULwWZp89c+P906hee3ueawyqZqFJlQbEG+4yFnJPkws2d4EdJHnFVKeDXlN19x9Y hnAlEEXI8NhbcBlJGrz6h47yHcoKLtcXt4lk+HnJE+kC1XoFDYelw+qv0GC4QjOjCKIi daA8OpBNbD10yDuaPDoLxzfnUhO/FVyeX5LuRmAtj1cHgNK+79LbTz0H1ZxZyKa1y2AK 0V1A== 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=t9KQ96BuTzDaAOnISxlyOYEAeHED77UkfUfw/CUKoME=; b=U5U0lGxaTcGV6G3fZrhQhnJR9JosxriaCqty3DF0O2SfYvAHvwYEHhsCO38lYrTwjg vKy3fbN8GgMXB/t8evHILl5cV/9ki9sYT3InuvsXpHwLfDmCa2MChwdgl/RY2LtQ0hIF QU9kzLsCsHidJjaDSmFVuhx4vU2VtZoyI/Dx2YO/Rz0FvjCdFYxln6ev73USwVJ82305 L+hqHg1MAFW/hbELt3AfIS7gWEABVzoxkzGzJ+ORmi9HKymznHOXKkh17lRL8n8bT/sJ DTD8yejFhLcTbTQ0q3b59ynwaRVoTxDpvqDupXxRGLn1fBFk/jyfMl8xBBdmIg9DQXv1 nMyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cl8DePJf; 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 e10-20020a170903240a00b001768b832a41si4722752plo.584.2022.11.18.11.28.04; Fri, 18 Nov 2022 11:28:18 -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=Cl8DePJf; 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 S241565AbiKRTQI (ORCPT <rfc822;kkmonlee@gmail.com> + 99 others); Fri, 18 Nov 2022 14:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235536AbiKRTQD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 18 Nov 2022 14:16:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F5848774; Fri, 18 Nov 2022 11:16:02 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8D3C8626B2; Fri, 18 Nov 2022 19:16:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 731E8C43470; Fri, 18 Nov 2022 19:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668798962; bh=3oaypFAauEKT+WjnVA3nrmkQ0TB+gA+2N8zEi8VAFLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cl8DePJfdv9aA0NMSkSSc/zpoCaWvkFV8xxuw4hQbl+k9Ne0G9b3f+m5FXGolow08 jaGGGXWSBUgjp47BgFkOYTBMIyTlNybmxEzqkK0NFG3jEG2uKoH/SL+USCqZje5uaS nGz7S+L68y+igN8pP2t72D9BAUTsTdsHods01hzBBKYzxf/jsKNfvYDRQK9hZ0bh1Y 5Tt2RpfvLxKh3DyUMyYYyGorLWL41JUFfxhzSUajleqXPqOaimbi6KwJcyXNZMaO+9 6PtYQl0s792Xmji33/yLX/7dQJ4KgqExhWx7VPFOhTA9CQDhoqErtVQrXFNbAz1XXc Ukav6xclsceyw== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada <masahiroy@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nick Terrell <terrelln@fb.com>, Nicolas Schier <nicolas@fjasle.eu>, Tom Rix <trix@redhat.com>, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2 2/2] kbuild: warn objects shared among multiple modules Date: Sat, 19 Nov 2022 04:15:51 +0900 Message-Id: <20221118191551.66448-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221118191551.66448-1-masahiroy@kernel.org> References: <20221118191551.66448-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?1749863312249132968?= X-GMAIL-MSGID: =?utf-8?q?1749863312249132968?= |
Series |
[v2,1/2] kbuild: add kbuild-file macro
|
|
Commit Message
Masahiro Yamada
Nov. 18, 2022, 7:15 p.m. UTC
If an object is shared among multiple modules, amd some of them are
configured as 'm', but the others as 'y', the shared object is built
as modular, then linked to the modules and vmlinux. This is a potential
issue because the expected CFLAGS are different between modules and
builtins.
Commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects")
reported that this could be even more fatal in some cases such as
Clang LTO.
That commit fixed lib/zlib/zstd_{compress,decompress}, but there are
still more instances of breakage.
This commit adds a W=1 warning for shared objects, so that the kbuild
test robot, which provides build tests with W=1, will avoid a new
breakage slipping in.
Quick compile tests on v6.1-rc4 detected the following:
scripts/Makefile.build:252: ./drivers/block/rnbd/Makefile: rnbd-common.o is added to multiple modules: rnbd-client rnbd-server
scripts/Makefile.build:252: ./drivers/crypto/marvell/octeontx2/Makefile: cn10k_cpt.o is added to multiple modules: rvu_cptpf rvu_cptvf
scripts/Makefile.build:252: ./drivers/crypto/marvell/octeontx2/Makefile: otx2_cptlf.o is added to multiple modules: rvu_cptpf rvu_cptvf
scripts/Makefile.build:252: ./drivers/crypto/marvell/octeontx2/Makefile: otx2_cpt_mbox_common.o is added to multiple modules: rvu_cptpf rvu_cptvf
scripts/Makefile.build:252: ./drivers/edac/Makefile: skx_common.o is added to multiple modules: i10nm_edac skx_edac
scripts/Makefile.build:252: ./drivers/gpu/drm/bridge/imx/Makefile: imx-ldb-helper.o is added to multiple modules: imx8qm-ldb imx8qxp-ldb
scripts/Makefile.build:252: ./drivers/mfd/Makefile: rsmu_core.o is added to multiple modules: rsmu-i2c rsmu-spi
scripts/Makefile.build:252: ./drivers/mtd/tests/Makefile: mtd_test.o is added to multiple modules: mtd_nandbiterrs mtd_oobtest mtd_pagetest mtd_readtest mtd_speedtest mtd_stresstest mtd_subpagetest mtd_torturetest
scripts/Makefile.build:252: ./drivers/net/dsa/ocelot/Makefile: felix.o is added to multiple modules: mscc_felix mscc_seville
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn23xx_pf_device.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn23xx_vf_device.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn66xx_device.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn68xx_device.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: lio_core.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: lio_ethtool.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_device.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_droq.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_mailbox.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_mem_ops.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_nic.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: request_manager.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: response_manager.o is added to multiple modules: liquidio liquidio_vf
scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/dpaa2/Makefile: dpaa2-mac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch
scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/dpaa2/Makefile: dpmac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch
scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/enetc/Makefile: enetc_cbdr.o is added to multiple modules: fsl-enetc fsl-enetc-vf
scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/enetc/Makefile: enetc_ethtool.o is added to multiple modules: fsl-enetc fsl-enetc-vf
scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/enetc/Makefile: enetc.o is added to multiple modules: fsl-enetc fsl-enetc-vf
scripts/Makefile.build:252: ./drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_cmd.o is added to multiple modules: hclge hclgevf
scripts/Makefile.build:252: ./drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_rss.o is added to multiple modules: hclge hclgevf
scripts/Makefile.build:252: ./drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_tqp_stats.o is added to multiple modules: hclge hclgevf
scripts/Makefile.build:252: ./drivers/net/ethernet/marvell/octeontx2/nic/Makefile: otx2_dcbnl.o is added to multiple modules: rvu_nicpf rvu_nicvf
scripts/Makefile.build:252: ./drivers/net/ethernet/marvell/octeontx2/nic/Makefile: otx2_devlink.o is added to multiple modules: rvu_nicpf rvu_nicvf
scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_ale.o is added to multiple modules: keystone_netcp keystone_netcp_ethss ti_cpsw ti_cpsw_new
scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_ethtool.o is added to multiple modules: ti_cpsw ti_cpsw_new
scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_priv.o is added to multiple modules: ti_cpsw ti_cpsw_new
scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_sl.o is added to multiple modules: ti_cpsw ti_cpsw_new
scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: davinci_cpdma.o is added to multiple modules: ti_cpsw ti_cpsw_new ti_davinci_emac
scripts/Makefile.build:252: ./drivers/platform/x86/intel/int3472/Makefile: common.o is added to multiple modules: intel_skl_int3472_discrete intel_skl_int3472_tps68470
scripts/Makefile.build:252: ./sound/soc/codecs/Makefile: wcd-clsh-v2.o is added to multiple modules: snd-soc-wcd9335 snd-soc-wcd934x snd-soc-wcd938x
Once all the warnings are fixed, it can become an error irrespective of
W= option.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Changes in v2:
- Add drivers/block/rnbd/Makefile for commit log
scripts/Makefile.build | 6 ++++++
1 file changed, 6 insertions(+)
Comments
From: Masahiro Yamada <masahiroy@kernel.org> Date: Sat, 19 Nov 2022 04:15:51 +0900 > If an object is shared among multiple modules, amd some of them are > configured as 'm', but the others as 'y', the shared object is built > as modular, then linked to the modules and vmlinux. This is a potential > issue because the expected CFLAGS are different between modules and > builtins. > > Commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects") > reported that this could be even more fatal in some cases such as > Clang LTO. > > That commit fixed lib/zlib/zstd_{compress,decompress}, but there are > still more instances of breakage. > > This commit adds a W=1 warning for shared objects, so that the kbuild > test robot, which provides build tests with W=1, will avoid a new > breakage slipping in. > > Quick compile tests on v6.1-rc4 detected the following: For the series: Reviewed-and-tested-by: Alexander Lobakin <alobakin@pm.me> [...] > Once all the warnings are fixed, it can become an error irrespective of > W= option. BTW I've fixed most of these (the ones that get build on typical x86_64 distroconfig) during my local tests, basing off your WIP tree. I could send a series if you wish. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > Changes in v2: > - Add drivers/block/rnbd/Makefile for commit log > > scripts/Makefile.build | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 37cf88d076e8..799df12b53f3 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -222,6 +222,10 @@ endif > > cmd_check_local_export = $(srctree)/scripts/check-local-export $@ > > +ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) > +cmd_warn_shared_object = $(if $(word 2, $(modname-multi)),$(warning $(kbuild-file): $*.o is added to multiple modules: $(modname-multi))) > +endif > + > define rule_cc_o_c > $(call cmd_and_fixdep,cc_o_c) > $(call cmd,gen_ksymdeps) > @@ -231,6 +235,7 @@ define rule_cc_o_c > $(call cmd,gen_objtooldep) > $(call cmd,gen_symversions_c) > $(call cmd,record_mcount) > + $(call cmd,warn_shared_object) > endef > > define rule_as_o_S > @@ -239,6 +244,7 @@ define rule_as_o_S > $(call cmd,check_local_export) > $(call cmd,gen_objtooldep) > $(call cmd,gen_symversions_S) > + $(call cmd,warn_shared_object) > endef > > # Built-in and composite module parts > -- > 2.34.1 Thanks, Olek
On Sat, Nov 19, 2022 at 6:36 AM Alexander Lobakin <alobakin@pm.me> wrote: > > From: Masahiro Yamada <masahiroy@kernel.org> > Date: Sat, 19 Nov 2022 04:15:51 +0900 > > > If an object is shared among multiple modules, amd some of them are > > configured as 'm', but the others as 'y', the shared object is built > > as modular, then linked to the modules and vmlinux. This is a potential > > issue because the expected CFLAGS are different between modules and > > builtins. > > > > Commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects") > > reported that this could be even more fatal in some cases such as > > Clang LTO. > > > > That commit fixed lib/zlib/zstd_{compress,decompress}, but there are > > still more instances of breakage. > > > > This commit adds a W=1 warning for shared objects, so that the kbuild > > test robot, which provides build tests with W=1, will avoid a new > > breakage slipping in. > > > > Quick compile tests on v6.1-rc4 detected the following: > > For the series: > > Reviewed-and-tested-by: Alexander Lobakin <alobakin@pm.me> > > [...] > > > Once all the warnings are fixed, it can become an error irrespective of > > W= option. > > BTW I've fixed most of these (the ones that get build on typical > x86_64 distroconfig) during my local tests, basing off your WIP > tree. I could send a series if you wish. Yes, thanks for the help. > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > --- > > > > Changes in v2: > > - Add drivers/block/rnbd/Makefile for commit log > > > > scripts/Makefile.build | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > index 37cf88d076e8..799df12b53f3 100644 > > --- a/scripts/Makefile.build > > +++ b/scripts/Makefile.build > > @@ -222,6 +222,10 @@ endif > > > > cmd_check_local_export = $(srctree)/scripts/check-local-export $@ > > > > +ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) > > +cmd_warn_shared_object = $(if $(word 2, $(modname-multi)),$(warning $(kbuild-file): $*.o is added to multiple modules: $(modname-multi))) > > +endif > > + > > define rule_cc_o_c > > $(call cmd_and_fixdep,cc_o_c) > > $(call cmd,gen_ksymdeps) > > @@ -231,6 +235,7 @@ define rule_cc_o_c > > $(call cmd,gen_objtooldep) > > $(call cmd,gen_symversions_c) > > $(call cmd,record_mcount) > > + $(call cmd,warn_shared_object) > > endef > > > > define rule_as_o_S > > @@ -239,6 +244,7 @@ define rule_as_o_S > > $(call cmd,check_local_export) > > $(call cmd,gen_objtooldep) > > $(call cmd,gen_symversions_S) > > + $(call cmd,warn_shared_object) > > endef > > > > # Built-in and composite module parts > > -- > > 2.34.1 > > Thanks, > Olek >
On Sat 19 Nov 2022 04:15:51 GMT, Masahiro Yamada wrote: > If an object is shared among multiple modules, amd some of them are amd -> and Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> > configured as 'm', but the others as 'y', the shared object is built > as modular, then linked to the modules and vmlinux. This is a potential > issue because the expected CFLAGS are different between modules and > builtins. > > Commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects") > reported that this could be even more fatal in some cases such as > Clang LTO. > > That commit fixed lib/zlib/zstd_{compress,decompress}, but there are > still more instances of breakage. > > This commit adds a W=1 warning for shared objects, so that the kbuild > test robot, which provides build tests with W=1, will avoid a new > breakage slipping in. > > Quick compile tests on v6.1-rc4 detected the following: > > scripts/Makefile.build:252: ./drivers/block/rnbd/Makefile: rnbd-common.o is added to multiple modules: rnbd-client rnbd-server > scripts/Makefile.build:252: ./drivers/crypto/marvell/octeontx2/Makefile: cn10k_cpt.o is added to multiple modules: rvu_cptpf rvu_cptvf > scripts/Makefile.build:252: ./drivers/crypto/marvell/octeontx2/Makefile: otx2_cptlf.o is added to multiple modules: rvu_cptpf rvu_cptvf > scripts/Makefile.build:252: ./drivers/crypto/marvell/octeontx2/Makefile: otx2_cpt_mbox_common.o is added to multiple modules: rvu_cptpf rvu_cptvf > scripts/Makefile.build:252: ./drivers/edac/Makefile: skx_common.o is added to multiple modules: i10nm_edac skx_edac > scripts/Makefile.build:252: ./drivers/gpu/drm/bridge/imx/Makefile: imx-ldb-helper.o is added to multiple modules: imx8qm-ldb imx8qxp-ldb > scripts/Makefile.build:252: ./drivers/mfd/Makefile: rsmu_core.o is added to multiple modules: rsmu-i2c rsmu-spi > scripts/Makefile.build:252: ./drivers/mtd/tests/Makefile: mtd_test.o is added to multiple modules: mtd_nandbiterrs mtd_oobtest mtd_pagetest mtd_readtest mtd_speedtest mtd_stresstest mtd_subpagetest mtd_torturetest > scripts/Makefile.build:252: ./drivers/net/dsa/ocelot/Makefile: felix.o is added to multiple modules: mscc_felix mscc_seville > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn23xx_pf_device.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn23xx_vf_device.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn66xx_device.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: cn68xx_device.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: lio_core.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: lio_ethtool.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_device.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_droq.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_mailbox.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_mem_ops.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: octeon_nic.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: request_manager.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/cavium/liquidio/Makefile: response_manager.o is added to multiple modules: liquidio liquidio_vf > scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/dpaa2/Makefile: dpaa2-mac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch > scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/dpaa2/Makefile: dpmac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch > scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/enetc/Makefile: enetc_cbdr.o is added to multiple modules: fsl-enetc fsl-enetc-vf > scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/enetc/Makefile: enetc_ethtool.o is added to multiple modules: fsl-enetc fsl-enetc-vf > scripts/Makefile.build:252: ./drivers/net/ethernet/freescale/enetc/Makefile: enetc.o is added to multiple modules: fsl-enetc fsl-enetc-vf > scripts/Makefile.build:252: ./drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_cmd.o is added to multiple modules: hclge hclgevf > scripts/Makefile.build:252: ./drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_rss.o is added to multiple modules: hclge hclgevf > scripts/Makefile.build:252: ./drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_tqp_stats.o is added to multiple modules: hclge hclgevf > scripts/Makefile.build:252: ./drivers/net/ethernet/marvell/octeontx2/nic/Makefile: otx2_dcbnl.o is added to multiple modules: rvu_nicpf rvu_nicvf > scripts/Makefile.build:252: ./drivers/net/ethernet/marvell/octeontx2/nic/Makefile: otx2_devlink.o is added to multiple modules: rvu_nicpf rvu_nicvf > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_ale.o is added to multiple modules: keystone_netcp keystone_netcp_ethss ti_cpsw ti_cpsw_new > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_ethtool.o is added to multiple modules: ti_cpsw ti_cpsw_new > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_priv.o is added to multiple modules: ti_cpsw ti_cpsw_new > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: cpsw_sl.o is added to multiple modules: ti_cpsw ti_cpsw_new > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: davinci_cpdma.o is added to multiple modules: ti_cpsw ti_cpsw_new ti_davinci_emac > scripts/Makefile.build:252: ./drivers/platform/x86/intel/int3472/Makefile: common.o is added to multiple modules: intel_skl_int3472_discrete intel_skl_int3472_tps68470 > scripts/Makefile.build:252: ./sound/soc/codecs/Makefile: wcd-clsh-v2.o is added to multiple modules: snd-soc-wcd9335 snd-soc-wcd934x snd-soc-wcd938x > > Once all the warnings are fixed, it can become an error irrespective of > W= option. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > Changes in v2: > - Add drivers/block/rnbd/Makefile for commit log > > scripts/Makefile.build | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 37cf88d076e8..799df12b53f3 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -222,6 +222,10 @@ endif > > cmd_check_local_export = $(srctree)/scripts/check-local-export $@ > > +ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) > +cmd_warn_shared_object = $(if $(word 2, $(modname-multi)),$(warning $(kbuild-file): $*.o is added to multiple modules: $(modname-multi))) > +endif > + > define rule_cc_o_c > $(call cmd_and_fixdep,cc_o_c) > $(call cmd,gen_ksymdeps) > @@ -231,6 +235,7 @@ define rule_cc_o_c > $(call cmd,gen_objtooldep) > $(call cmd,gen_symversions_c) > $(call cmd,record_mcount) > + $(call cmd,warn_shared_object) > endef > > define rule_as_o_S > @@ -239,6 +244,7 @@ define rule_as_o_S > $(call cmd,check_local_export) > $(call cmd,gen_objtooldep) > $(call cmd,gen_symversions_S) > + $(call cmd,warn_shared_object) > endef > > # Built-in and composite module parts > -- > 2.34.1
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 37cf88d076e8..799df12b53f3 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -222,6 +222,10 @@ endif cmd_check_local_export = $(srctree)/scripts/check-local-export $@ +ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) +cmd_warn_shared_object = $(if $(word 2, $(modname-multi)),$(warning $(kbuild-file): $*.o is added to multiple modules: $(modname-multi))) +endif + define rule_cc_o_c $(call cmd_and_fixdep,cc_o_c) $(call cmd,gen_ksymdeps) @@ -231,6 +235,7 @@ define rule_cc_o_c $(call cmd,gen_objtooldep) $(call cmd,gen_symversions_c) $(call cmd,record_mcount) + $(call cmd,warn_shared_object) endef define rule_as_o_S @@ -239,6 +244,7 @@ define rule_as_o_S $(call cmd,check_local_export) $(call cmd,gen_objtooldep) $(call cmd,gen_symversions_S) + $(call cmd,warn_shared_object) endef # Built-in and composite module parts