Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1681950ioo; Mon, 23 May 2022 00:07:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyht5qMusgCi7ljccnnChuZrR43uYllANoM/5X93LhEHiWCMZv4PEPZ2Ajc1hJV9sQ/M/NG X-Received: by 2002:a63:f653:0:b0:3fa:ac4:d910 with SMTP id u19-20020a63f653000000b003fa0ac4d910mr7396654pgj.407.1653289660663; Mon, 23 May 2022 00:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653289660; cv=none; d=google.com; s=arc-20160816; b=DAhjYJnG8XzB514/fmdZVf6rSPxvExiRAYR0OVv23dW2EhJJHCDgSsB3Bi0H91N1Bh QAJ0vqXaP+/ZrTiB53f94oF7HaxQY84Ap7e5uM1UXwWI/FY9RPR+x0L4JDpe1HJ5zHK/ piMvcKDjpafH/SJsNDEEbcksp33mzpfJWpS47yOay9IbpjLAXPiikKjxcjrFcw0xMihw XyceBcHLGupjeh8O62WVH2Gd64aJ9Reipp7pzTGB0RPFHJsd0xKpvjWW3RS1ntdYzZtq YzQfGvkGkK4U71VXwfieXT75cVyHPrXEALnXVT+hUK6X686QcilKosW2zesTFZC8WEVf W9MQ== 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=Xf8NCYo0YOY0bu0jQcQFs+Y8y5oCImuro2ljp5V6ip8=; b=NNrdyEmM9XBniHOPAq6HiLobBvfmDBVFT14sDqPX1JuLKNdHTOBwvxMmwpvH0AdNPH phR+Ih8IlYi9grlYRFcjlOuBqPjXV/tuSi6ZZLIkZrRx+YlBP6ZHm6/GAdfj1bnWZN5Z wL1m7jYN5j/I6KcHuaHHNGZfEGTTrxYH5Iwt6Q1g2zRN5Zzy0xPXu8wsDVJ5nhwau9Hb dMtMo8DJP+2wJXT2jVvTPuDziPa1hAEmxrLjnbMO94Tb4GyaRz6bChh/BOaHol9V3l88 Pai5gag0X+TFs+tsLpnQ5YKLTSwKQLI2r3dLmzAJKsOJT9wQmb+mSXu8l9etwAHjqARp pjrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ZZXzFo08; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l184-20020a6388c1000000b003fa0de2357fsi6226285pgd.6.2022.05.23.00.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ZZXzFo08; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3272D6C568; Sun, 22 May 2022 23:28:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354543AbiEUEQq (ORCPT + 99 others); Sat, 21 May 2022 00:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354585AbiEUEQV (ORCPT ); Sat, 21 May 2022 00:16:21 -0400 X-Greylist: delayed 140 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 20 May 2022 21:16:11 PDT Received: from conssluserg-06.nifty.com (conssluserg-06.nifty.com [210.131.2.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E2F643C; Fri, 20 May 2022 21:16:08 -0700 (PDT) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 24L4FUIi003497; Sat, 21 May 2022 13:15:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 24L4FUIi003497 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1653106531; bh=Xf8NCYo0YOY0bu0jQcQFs+Y8y5oCImuro2ljp5V6ip8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZZXzFo08FpfLUVD9UO80XU+0Efkc74oNFrA6OLIxxXMqqA76QbqTl/WHeKugnGPnf fd1cY6IN+BQdngSibRpE4pnkctuXxQn/Sdky98WJ6YcYunUQYfumpoAJ9rviao90e+ 4+xWf0OJg0GRdoPqMpC/hVLBLdIaUFwNTDsrO3eoJ1pdWwj1v12xehdfs6+/Zj1KIc h0U9Co+FJXpyV2uGJZwnYMi7XYSi3a3O39BHN2OiepffWjFp2pGr/wx0vBapqgtJPH 2fSQGiNj6/WMVMsvoSt3yXizW5dA816cl6zIOa8ATAVJnXz9yHY0H/Ii/py17KMQsX EU888zGjcbBug== X-Nifty-SrcIP: [209.85.216.52] Received: by mail-pj1-f52.google.com with SMTP id nk9-20020a17090b194900b001df2fcdc165so13073908pjb.0; Fri, 20 May 2022 21:15:31 -0700 (PDT) X-Gm-Message-State: AOAM530c8LPxDeARtFu2K7ZWBO+MRFNhBfshCpnuiSUK7R5OGrkX3Axn 90cNe8EtDpr2TJYAG8efChDRRMJHG6+xAkoMvNc= X-Received: by 2002:a17:90a:e7cd:b0:1dc:74eb:7526 with SMTP id kb13-20020a17090ae7cd00b001dc74eb7526mr14425148pjb.144.1653106530271; Fri, 20 May 2022 21:15:30 -0700 (PDT) MIME-Version: 1.0 References: <18500f18-9cd5-a81c-4a55-14e999ed4496@infradead.org> <3ae306e0-c6c7-ed12-cacd-62b1c26dba3c@infradead.org> <6671de03-c09c-bfaf-e06c-e45af70d4354@infradead.org> <6601a387-de9a-a0d0-11b5-01e0cfa75657@infradead.org> In-Reply-To: <6601a387-de9a-a0d0-11b5-01e0cfa75657@infradead.org> From: Masahiro Yamada Date: Sat, 21 May 2022 13:14:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o To: Randy Dunlap Cc: Linux Kbuild mailing list , Liam Beguin , "linux-kernel@vger.kernel.org" , linux-iio@vger.kernel.org, Peter Rosin , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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, May 21, 2022 at 12:51 PM Randy Dunlap wrote: > > Ok, one more. > [also adding Liam here] > > On 5/20/22 20:17, Randy Dunlap wrote: > > > > > > On 5/20/22 20:08, Randy Dunlap wrote: > >> > >> > >> On 5/20/22 19:40, Randy Dunlap wrote: > >>> Hi, > >>> > >>> In March I reported that a randconfig build complained: > >>> > >>> ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o > >>> > >>> (https://lore.kernel.org/all/16509fb6-e40c-e31b-2c80-264c44b0beb9@infradead.org/) > >>> > >>> I am still seeing this problem so I tried to dig into it a bit. > >>> However, I don't see why get_next_modinfo() and friends don't find the > >>> MODULE_LICENSE() since it is in the iio-rescale.o file. > >>> > >>> (BTW, I see this build error on many different $ARCH [around 15 tested] > >>> and with 2 different versions of GCC.) > >>> > >>> Q1: Is modpost checking both vmlinux and iio-rescale.o for modinfo license > >>> strings? > >>> > >>> It looks like it is, because it appears (?) that modpost is looking at > >>> drivers/iio/test/iio-test-rescale.o (<<<<< a kunit test, which is builtin > >>> in my .config) and at drivers/iio/afe/iio-rescale.o (which is built as a > >>> loadable module). > >>> > >>> Is this confusing modpost? > >>> I renamed drivers/iio/afe/iio-rescale.c to afe-rescale.c and changed its > >>> Makefile entry accordingly and the MODULE_LICENSE error goes away. > >> > >> Oh well. This rename causes drivers/iio/test/iio-test-rescale.c to have > >> build errors, so that's not a solution, just some info... > > > > and that was due to not updating drivers/iio/test/Makefile. > > When that is done, the missing MODULE_LICENSE() is back in afe-rescale.o. > > > >> > >>> Is this a modpost error or is kunit messing things up? > >>> > >>> thanks for looking. > > Does this look OK? It allows afe/iio-rescale.o to build XOR > test/iio-rescale.o (not both of them). > > --- a/drivers/iio/test/Kconfig > +++ b/drivers/iio/test/Kconfig > @@ -6,7 +6,7 @@ > # Keep in alphabetical order > config IIO_RESCALE_KUNIT_TEST > bool "Test IIO rescale conversion functions" > - depends on KUNIT=y && !IIO_RESCALE > + depends on KUNIT=y && IIO_RESCALE=n > default KUNIT_ALL_TESTS > help > If you want to run tests on the iio-rescale code say Y here. > > > -- > ~Randy As you may have already noticed, the root cause is drivers/iio/test/Makefile obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o ../afe/iio-rescale.o For the combination of CONFIG_IIO_RESCALE=m CONFIG_IIO_RESCALE_KUNIT_TEST=y, drivers/iio/afe/iio-rescale.o is built twice; as modular by drivers/iio/afe/Makefile, and as built-in by drivers/iio/test/Makefile. That's why MODULE_LICENSE() is lost. I think your solution will work although this Makefile is not recommended. -- Best Regards Masahiro Yamada