On Wed, Mar 10, 2021 at 10:47 PM Nicolas Pitre <[email protected]> wrote: ... > > With CONFIG_TRIM_UNUSED_KSYMS=y I see a 3x-loops of building .version > > and folowing steps - got no answer if this is intended. > > Yes it is intended. I explained it here: > > https://lkml.org/lkml/2021/3/9/1099 >
Ah, cool. Thanks for that link. > With CONFIG_TRIM_UNUSED_KSYMS some EXPORT_SYMBOL() are removed, which > allows for optimizing away the corresponding code, which in turn opens > the possibility for more EXPORT_SYMBOL() to be removed, etc. The process > eventually converge to a stable build. Normally only 2 passes are needed > to converge, but LTO opens the possibilities for extra passes. > > > Means longer build-time. > > Oh, absolutely. LTO (at least when I played with it) is slow. Add the > multi-pass from CONFIG_TRIM_UNUSED_KSYMS on top of that and your kernel > build becomes agonizingly slow. This is not something you want when > doing kernel development. > Thanks for the feedback. > > I did not follow this anymore as both Kconfigs with Clang-LTO consume > > more build-time and the resulting vmlinux is some MiB bigger than with > > Clang-CFI. > > That's rather strange. At least with gcc LTO I always obtained smaller > kernels. > I cannot say much to GCC-LTO - I never used it. If you are interested in Clang-CFI (see [1]) - which requires Clang-LTO enabled and LLVM/Clang >= 12. Some hours ago version 12.0.0-rc3 was released, see [2]. - Sedat - [1] https://github.com/samitolvanen/linux/commits/clang-cfi [2] https://github.com/ClangBuiltLinux/linux/issues/1259

