Re: [PATCH] modpost: add an option to suppress 'exported twice' warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx> writes:

> Since commit "modpost: do not set ->preloaded for symbols from
> Module.symvers", the modpost always warns about symbols exported
> multiple times.
>
> Generally, I believe it is a good thing to show a warning when the
> same symbol name is exported twice. This avoids the accidental symbol
> conflict.
>
> However, in some cases, we build an external module to provide a
> different version/variant of the in-kernel module, overriding the
> same set of exported symbols.
>
> At least, there is one use-case in the upstream code;
> tools/testing/nvdimm/libnvdimm.ko replaces drivers/nvdimm/libnvdimm.ko
> in order to link it against mocked version of core kernel symbols.
>
> Now, this emits a lots of 'exported twice' warnings:
>
>   https://lkml.org/lkml/2019/10/31/627
>
> To suppress those, add a new option KBUILD_DUPLICATED_EXPORTS_NO_WARN.
>
> If you intentionally override the existing symbols, you can pass it
> from the command line:
>
>   make M=tools/testing/nvdimm KBUILD_DUPLICATED_EXPORTS_NO_WARN=1
>
> Or, more conveniently, you can add it to the module Makefile, so
> you can still do:
>
>   make M=tools/testing/nvdimm
>
> without sprinkling the warnings.
>
> Reported-by: Jeff Moyer <jmoyer@xxxxxxxxxx>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
> ---
>
> Jeff Moyer,
> Dan Williams,
>
> Please check if this patch solves the nvdimm build issue.

Yep, that fixes it for me.

You can add:

Tested-by: Jeff Moyer <jmoyer@xxxxxxxxxx>

Thanks!





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux