Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION
From: Sedat Dilek <hidden>
Date: 2021-03-10 21:58:58
Also in:
lkml
On Wed, Mar 10, 2021 at 10:47 PM Nicolas Pitre [off-list ref] wrote: ...
quoted
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.quoted
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.
quoted
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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel