Re: [PATCH v2] kbuild: fix UNUSED_KSYMS_WHITELIST for Clang LTO

From: Masahiro Yamada
Date: Sat Feb 27 2021 - 01:57:23 EST


On Fri, Feb 26, 2021 at 6:26 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>
> On Fri, Feb 26, 2021 at 7:26 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > Commit fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
> > does not work as expected if the .config file has already specified
> > CONFIG_UNUSED_KSYMS_WHITELIST="my/own/white/list" before enabling
> > CONFIG_LTO_CLANG.
> >
> > So, the user-supplied whitelist and LTO-specific white list must be
> > independent of each other.
> >
> > I refactored the shell script so CONFIG_MODVERSIONS and CONFIG_CLANG_LTO
> > handle whitelists in the same way.
> >
> > Fixes: fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
> > Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> > ---
> >
> > Changes in v2:
> > - Rebase on top of Arnd's patch:
> > https://lore.kernel.org/lkml/20210225143456.3829513-1-arnd@xxxxxxxxxx/
> >
> > init/Kconfig | 1 -
> > scripts/gen_autoksyms.sh | 35 ++++++++++++++++++++++++---------
> > scripts/lto-used-symbollist.txt | 6 ------
>
> People who want to use their own "white-listed" (allow-listed)
> symbollist-file can do that via
> CONFIG_UNUSED_KSYMS_WHITELIST="my/own/white/list".
> Correct?
>
> Why do you delete the default "scripts/lto-used-symbollist.txt" file
> and remove the default in the appropriate Kconfig for people who want
> to enable Clang-(Thin)LTO?
> These people should now use
> CONFIG_UNUSED_KSYMS_WHITELIST="scripts/lto-used-symbollist.txt"?
> But again - the file was deleted with your patch.
> Do I miss something?

I think so.

I moved those symbols to scripts/gen_autoksyms.sh





--
Best Regards
Masahiro Yamada