* kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o @ 2022-05-21 2:40 Randy Dunlap 2022-05-21 3:08 ` Randy Dunlap 2022-05-21 4:12 ` Masahiro Yamada 0 siblings, 2 replies; 13+ messages in thread From: Randy Dunlap @ 2022-05-21 2:40 UTC (permalink / raw) To: Linux Kbuild mailing list, Masahiro Yamada Cc: linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development 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. Is this a modpost error or is kunit messing things up? thanks for looking. -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 2:40 kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o Randy Dunlap @ 2022-05-21 3:08 ` Randy Dunlap 2022-05-21 3:17 ` Randy Dunlap 2022-05-21 4:12 ` Masahiro Yamada 1 sibling, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2022-05-21 3:08 UTC (permalink / raw) To: Linux Kbuild mailing list, Masahiro Yamada Cc: linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development 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... > Is this a modpost error or is kunit messing things up? > > thanks for looking. -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 3:08 ` Randy Dunlap @ 2022-05-21 3:17 ` Randy Dunlap 2022-05-21 3:51 ` Randy Dunlap 0 siblings, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2022-05-21 3:17 UTC (permalink / raw) To: Linux Kbuild mailing list, Masahiro Yamada Cc: linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development 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. > -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 3:17 ` Randy Dunlap @ 2022-05-21 3:51 ` Randy Dunlap 2022-05-21 4:14 ` Masahiro Yamada 2022-05-26 15:36 ` Randy Dunlap 0 siblings, 2 replies; 13+ messages in thread From: Randy Dunlap @ 2022-05-21 3:51 UTC (permalink / raw) To: Linux Kbuild mailing list, Masahiro Yamada, Liam Beguin Cc: linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 3:51 ` Randy Dunlap @ 2022-05-21 4:14 ` Masahiro Yamada 2022-05-21 5:39 ` Randy Dunlap 2022-05-26 15:36 ` Randy Dunlap 1 sibling, 1 reply; 13+ messages in thread From: Masahiro Yamada @ 2022-05-21 4:14 UTC (permalink / raw) To: Randy Dunlap Cc: Linux Kbuild mailing list, Liam Beguin, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development On Sat, May 21, 2022 at 12:51 PM Randy Dunlap <rdunlap@infradead.org> 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 4:14 ` Masahiro Yamada @ 2022-05-21 5:39 ` Randy Dunlap 0 siblings, 0 replies; 13+ messages in thread From: Randy Dunlap @ 2022-05-21 5:39 UTC (permalink / raw) To: Masahiro Yamada Cc: Linux Kbuild mailing list, Liam Beguin, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development On 5/20/22 21:14, Masahiro Yamada wrote: > On Sat, May 21, 2022 at 12:51 PM Randy Dunlap <rdunlap@infradead.org> 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. Yeah, I don't care for how that is done either. -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 3:51 ` Randy Dunlap 2022-05-21 4:14 ` Masahiro Yamada @ 2022-05-26 15:36 ` Randy Dunlap 2022-05-26 16:04 ` Liam Beguin 1 sibling, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2022-05-26 15:36 UTC (permalink / raw) To: Linux Kbuild mailing list, Masahiro Yamada, Liam Beguin Cc: linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development Liam: Any comment on this? Otherwise I'll just send a formal patch like this (below). Thanks. On 5/20/22 20:51, 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-26 15:36 ` Randy Dunlap @ 2022-05-26 16:04 ` Liam Beguin 2022-05-26 20:04 ` Randy Dunlap 0 siblings, 1 reply; 13+ messages in thread From: Liam Beguin @ 2022-05-26 16:04 UTC (permalink / raw) To: Randy Dunlap Cc: Linux Kbuild mailing list, Masahiro Yamada, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development Hi Randy, On Thu, May 26, 2022 at 08:36:34AM -0700, Randy Dunlap wrote: > Liam: > > Any comment on this? > Otherwise I'll just send a formal patch like this (below). Apologies for not answering earlier. I wanted to look more into Masahiro's comment and try to fix the Makefile, but that can be done after. IMO your patch improves the current Kconfig, so I'd recommend sending the patch. If it can wait a bit, I can look at the Makefile over the weekend. Cheers, Liam > > Thanks. > > On 5/20/22 20:51, 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-26 16:04 ` Liam Beguin @ 2022-05-26 20:04 ` Randy Dunlap 2022-05-29 21:20 ` Liam Beguin 0 siblings, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2022-05-26 20:04 UTC (permalink / raw) To: Liam Beguin Cc: Linux Kbuild mailing list, Masahiro Yamada, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development On 5/26/22 09:04, Liam Beguin wrote: > Hi Randy, > > On Thu, May 26, 2022 at 08:36:34AM -0700, Randy Dunlap wrote: >> Liam: >> >> Any comment on this? >> Otherwise I'll just send a formal patch like this (below). > > Apologies for not answering earlier. > > I wanted to look more into Masahiro's comment and try to fix the > Makefile, but that can be done after. > > IMO your patch improves the current Kconfig, so I'd recommend sending > the patch. If it can wait a bit, I can look at the Makefile over the > weekend. > Liam, I'll wait until next week to see if you come up with anything. Thanks. > >> >> Thanks. >> >> On 5/20/22 20:51, 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 -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-26 20:04 ` Randy Dunlap @ 2022-05-29 21:20 ` Liam Beguin 2022-05-30 0:17 ` Randy Dunlap 0 siblings, 1 reply; 13+ messages in thread From: Liam Beguin @ 2022-05-29 21:20 UTC (permalink / raw) To: Randy Dunlap Cc: Linux Kbuild mailing list, Masahiro Yamada, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development Hi Randy, On Thu, May 26, 2022 at 01:04:41PM -0700, Randy Dunlap wrote: > > > On 5/26/22 09:04, Liam Beguin wrote: > > Hi Randy, > > > > On Thu, May 26, 2022 at 08:36:34AM -0700, Randy Dunlap wrote: > >> Liam: > >> > >> Any comment on this? > >> Otherwise I'll just send a formal patch like this (below). > > > > Apologies for not answering earlier. > > > > I wanted to look more into Masahiro's comment and try to fix the > > Makefile, but that can be done after. > > > > IMO your patch improves the current Kconfig, so I'd recommend sending > > the patch. If it can wait a bit, I can look at the Makefile over the > > weekend. > > > > Liam, > > I'll wait until next week to see if you come up with anything. > The following patch fixes the issue while addressing Masahiro's comment. I also considered `select IIO_RESCALE`, but I'm not sure what's usually preferred. diff --git a/drivers/iio/test/Kconfig b/drivers/iio/test/Kconfig index 56ca0ad7e77a..4c66c3f18c34 100644 --- 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=y default KUNIT_ALL_TESTS help If you want to run tests on the iio-rescale code say Y here. diff --git a/drivers/iio/test/Makefile b/drivers/iio/test/Makefile index f15ae0a6394f..880360f8d02c 100644 --- a/drivers/iio/test/Makefile +++ b/drivers/iio/test/Makefile @@ -4,6 +4,6 @@ # # Keep in alphabetical order -obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o ../afe/iio-rescale.o +obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o obj-$(CONFIG_IIO_TEST_FORMAT) += iio-test-format.o CFLAGS_iio-test-format.o += $(DISABLE_STRUCTLEAK_PLUGIN) I'll send a patch as soon as you confirm this works for you too. Cheers, Liam > > > > >> > >> Thanks. > >> > >> On 5/20/22 20:51, 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 > > -- > ~Randy ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-29 21:20 ` Liam Beguin @ 2022-05-30 0:17 ` Randy Dunlap 2022-05-30 2:37 ` Masahiro Yamada 0 siblings, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2022-05-30 0:17 UTC (permalink / raw) To: Liam Beguin Cc: Linux Kbuild mailing list, Masahiro Yamada, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development On 5/29/22 14:20, Liam Beguin wrote: > Hi Randy, > > On Thu, May 26, 2022 at 01:04:41PM -0700, Randy Dunlap wrote: >> >> >> On 5/26/22 09:04, Liam Beguin wrote: >>> Hi Randy, >>> >>> On Thu, May 26, 2022 at 08:36:34AM -0700, Randy Dunlap wrote: >>>> Liam: >>>> >>>> Any comment on this? >>>> Otherwise I'll just send a formal patch like this (below). >>> >>> Apologies for not answering earlier. >>> >>> I wanted to look more into Masahiro's comment and try to fix the >>> Makefile, but that can be done after. >>> >>> IMO your patch improves the current Kconfig, so I'd recommend sending >>> the patch. If it can wait a bit, I can look at the Makefile over the >>> weekend. >>> >> >> Liam, >> >> I'll wait until next week to see if you come up with anything. >> > > The following patch fixes the issue while addressing Masahiro's comment. > I also considered `select IIO_RESCALE`, but I'm not sure what's usually > preferred. > > diff --git a/drivers/iio/test/Kconfig b/drivers/iio/test/Kconfig > index 56ca0ad7e77a..4c66c3f18c34 100644 > --- 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=y > default KUNIT_ALL_TESTS > help > If you want to run tests on the iio-rescale code say Y here. > diff --git a/drivers/iio/test/Makefile b/drivers/iio/test/Makefile > index f15ae0a6394f..880360f8d02c 100644 > --- a/drivers/iio/test/Makefile > +++ b/drivers/iio/test/Makefile > @@ -4,6 +4,6 @@ > # > > # Keep in alphabetical order > -obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o ../afe/iio-rescale.o > +obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o > obj-$(CONFIG_IIO_TEST_FORMAT) += iio-test-format.o > CFLAGS_iio-test-format.o += $(DISABLE_STRUCTLEAK_PLUGIN) > > I'll send a patch as soon as you confirm this works for you too. Looks good. Thanks. Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-30 0:17 ` Randy Dunlap @ 2022-05-30 2:37 ` Masahiro Yamada 0 siblings, 0 replies; 13+ messages in thread From: Masahiro Yamada @ 2022-05-30 2:37 UTC (permalink / raw) To: Randy Dunlap Cc: Liam Beguin, Linux Kbuild mailing list, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development On Mon, May 30, 2022 at 9:17 AM Randy Dunlap <rdunlap@infradead.org> wrote: > > > > On 5/29/22 14:20, Liam Beguin wrote: > > Hi Randy, > > > > On Thu, May 26, 2022 at 01:04:41PM -0700, Randy Dunlap wrote: > >> > >> > >> On 5/26/22 09:04, Liam Beguin wrote: > >>> Hi Randy, > >>> > >>> On Thu, May 26, 2022 at 08:36:34AM -0700, Randy Dunlap wrote: > >>>> Liam: > >>>> > >>>> Any comment on this? > >>>> Otherwise I'll just send a formal patch like this (below). > >>> > >>> Apologies for not answering earlier. > >>> > >>> I wanted to look more into Masahiro's comment and try to fix the > >>> Makefile, but that can be done after. > >>> > >>> IMO your patch improves the current Kconfig, so I'd recommend sending > >>> the patch. If it can wait a bit, I can look at the Makefile over the > >>> weekend. > >>> > >> > >> Liam, > >> > >> I'll wait until next week to see if you come up with anything. > >> > > > > The following patch fixes the issue while addressing Masahiro's comment. > > I also considered `select IIO_RESCALE`, but I'm not sure what's usually > > preferred. > > > > diff --git a/drivers/iio/test/Kconfig b/drivers/iio/test/Kconfig > > index 56ca0ad7e77a..4c66c3f18c34 100644 > > --- 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=y > > default KUNIT_ALL_TESTS > > help > > If you want to run tests on the iio-rescale code say Y here. > > diff --git a/drivers/iio/test/Makefile b/drivers/iio/test/Makefile > > index f15ae0a6394f..880360f8d02c 100644 > > --- a/drivers/iio/test/Makefile > > +++ b/drivers/iio/test/Makefile > > @@ -4,6 +4,6 @@ > > # > > > > # Keep in alphabetical order > > -obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o ../afe/iio-rescale.o > > +obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o > > obj-$(CONFIG_IIO_TEST_FORMAT) += iio-test-format.o > > CFLAGS_iio-test-format.o += $(DISABLE_STRUCTLEAK_PLUGIN) > > > > I'll send a patch as soon as you confirm this works for you too. > > Looks good. Thanks. > > Acked-by: Randy Dunlap <rdunlap@infradead.org> > Tested-by: Randy Dunlap <rdunlap@infradead.org> > > -- > ~Randy Reviewed-by: Masahiro Yamada <masahiroy@kernel.org> -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o 2022-05-21 2:40 kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o Randy Dunlap 2022-05-21 3:08 ` Randy Dunlap @ 2022-05-21 4:12 ` Masahiro Yamada 1 sibling, 0 replies; 13+ messages in thread From: Masahiro Yamada @ 2022-05-21 4:12 UTC (permalink / raw) To: Randy Dunlap Cc: Linux Kbuild mailing list, linux-kernel, linux-iio, Peter Rosin, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development On Sat, May 21, 2022 at 11:40 AM Randy Dunlap <rdunlap@infradead.org> 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? MODULE_LICENSE() is no-op for vmlinux. modpost checks this only for modules. > > 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. > > Is this a modpost error or is kunit messing things up? > > thanks for looking. > -- > ~Randy -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-05-30 2:39 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-05-21 2:40 kbuild problem: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o Randy Dunlap 2022-05-21 3:08 ` Randy Dunlap 2022-05-21 3:17 ` Randy Dunlap 2022-05-21 3:51 ` Randy Dunlap 2022-05-21 4:14 ` Masahiro Yamada 2022-05-21 5:39 ` Randy Dunlap 2022-05-26 15:36 ` Randy Dunlap 2022-05-26 16:04 ` Liam Beguin 2022-05-26 20:04 ` Randy Dunlap 2022-05-29 21:20 ` Liam Beguin 2022-05-30 0:17 ` Randy Dunlap 2022-05-30 2:37 ` Masahiro Yamada 2022-05-21 4:12 ` Masahiro Yamada
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.