Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1566766rwb; Fri, 18 Nov 2022 22:34:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf7/PKnSj7kqCDZwTgKVmLaXHEoaTeigiphHvLfZflMcTHCH8Z/+08I3w8/wa95nIP5U+6FL X-Received: by 2002:a65:68da:0:b0:477:4a00:6ce8 with SMTP id k26-20020a6568da000000b004774a006ce8mr1696384pgt.502.1668839676769; Fri, 18 Nov 2022 22:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668839676; cv=none; d=google.com; s=arc-20160816; b=OJrtM3/kZ99T08Geh4g6AgSrJNxAXSkzXGRPIPNHXsi32sbsRkEnFTfVvLFlFdCbpK PnLZAEW3KnWTH9Kobaz/M/NMxG5JPxl1fzUEpTecufHNi9a2IkN/0jOAeYt9UZZyxhUi UBSGm6X4hbsiFp5Yqu2ueW4/cE1zu6aBenFttdsN1mOiJBJM8uDXygGv/PH+grHMybXM Cpv+IcLPttztp4x+k7z6+gor6J6UEUk7m73DhsEbCeO/f5EqypCT0dbfqS6qv2+LncS3 5efGXKTVwf8g89aLt8h4JSIBH9DiZ29htHoRDY/xSjeGNK7qj07RQ5XeYL2Z/fq/Ls1n GpbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=hw+7QfHms6qg0bK0VXx5PywoCJxCHZ+mTJrxNjSJVz4=; b=ebpk9jTdYXvJERTQHyuhpjaGzY6PhSu8/7vStdCBqxinRJ9GX2ur6q3TS9KGi9SPRr pbghsRA2E/4Y6fe+kj+S2e4mb+uwjutZae2nzdp/rBZnEcPqMpB1bnHNHDyR/VcjtXxi wqIEWbjlH4jMnaAmLtuRVfGwivLfAe/a0sQFTbTVwt4IhPWxofAkOe5ZM0xrVfxApSRr KG1FvOhGWl7o3c3T49OozzLM4bRLgO+8/U1xJHbXrZFitJGABT8y1O1uLUIDTGsRPIHZ 7k7XqWk23p4PAs/aX8XNibqJqftzgLtUv97T4DLdqyrEqfOjlfUDcTVzFvEUPDiHpy3n Rs9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vNab5eOV; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls5-20020a17090b350500b00202880e0827si10623285pjb.28.2022.11.18.22.34.25; Fri, 18 Nov 2022 22:34:36 -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=@nifty.com header.s=dec2015msa header.b=vNab5eOV; 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 S232054AbiKSGKn (ORCPT + 91 others); Sat, 19 Nov 2022 01:10:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiKSGKl (ORCPT ); Sat, 19 Nov 2022 01:10:41 -0500 Received: from conssluserg-06.nifty.com (conssluserg-06.nifty.com [210.131.2.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D51F693CF7; Fri, 18 Nov 2022 22:10:38 -0800 (PST) Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 2AJ6AFtX020437; Sat, 19 Nov 2022 15:10:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 2AJ6AFtX020437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1668838216; bh=hw+7QfHms6qg0bK0VXx5PywoCJxCHZ+mTJrxNjSJVz4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vNab5eOVQ5LmrgNQqePwKMQ0jUfu8K/ULgd0oPIRIRNYnm7JvcKY/lT4uKWd8apGR anL3uC0NaYSU2eDsOLRXBdViLYI89WXkYZlV+TX6id4CwQcLEn/PTeOwM7RQ/jSwxg bD9WWzh6bRYHN8gETcKvq/tQLGMxqnarvaP6+SWiKhUKreTHkrBbD/4PtMj6uZF4BA t5yCh/FPZmjb5hfGlvR5sf7Qqw4B8YuEUxcME6d5D6tvfvwStFQFImEHUE8IWHBr/S 6H7WYv9+vzG8IK9ubYghO/Cpkhk/DAkg2b0xNLwdACu0Y5UFGhiQks8AR3xffdFQav d1RmsGa/+qkeg== X-Nifty-SrcIP: [209.85.167.172] Received: by mail-oi1-f172.google.com with SMTP id q83so7593256oib.10; Fri, 18 Nov 2022 22:10:16 -0800 (PST) X-Gm-Message-State: ANoB5plLRKr10caOt2Go4XvkciM0N+hF+gFJePIlgZp5WLYcqWxkz8qo SXFDCgrM9+VGzjyoKc4zkZS32uvxwP0FqQfOjwY= X-Received: by 2002:aca:1c06:0:b0:354:28ae:23b3 with SMTP id c6-20020aca1c06000000b0035428ae23b3mr4994580oic.287.1668838215020; Fri, 18 Nov 2022 22:10:15 -0800 (PST) MIME-Version: 1.0 References: <20221118191551.66448-1-masahiroy@kernel.org> <20221118191551.66448-2-masahiroy@kernel.org> <20221118212839.148107-1-alobakin@pm.me> In-Reply-To: <20221118212839.148107-1-alobakin@pm.me> From: Masahiro Yamada Date: Sat, 19 Nov 2022 15:09:38 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: warn objects shared among multiple modules To: Alexander Lobakin Cc: linux-kbuild@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nick Terrell , Nicolas Schier , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 19, 2022 at 6:36 AM Alexander Lobakin wrote: > > From: Masahiro Yamada > 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 > > [...] > > > 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 > > --- > > > > 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 > -- Best Regards Masahiro Yamada