Re: [PATCH v8 00/16] Add support for Clang LTO
From: Arnd Bergmann <arnd@kernel.org>
Date: 2020-12-09 17:52:41
Also in:
linux-arch, linux-kbuild, linux-pci, lkml
From: Arnd Bergmann <arnd@kernel.org>
Date: 2020-12-09 17:52:41
Also in:
linux-arch, linux-kbuild, linux-pci, lkml
On Wed, Dec 9, 2020 at 5:25 PM 'Sami Tolvanen' via Clang Built Linux [off-list ref] wrote:
On Wed, Dec 9, 2020 at 4:36 AM Arnd Bergmann [off-list ref] wrote:quoted
On Tue, Dec 8, 2020 at 1:15 PM Arnd Bergmann [off-list ref] wrote: It seems to happen because of CONFIG_TRIM_UNUSED_KSYMS, which is a shame, since I think that is an option we'd always want to have enabled with LTO, to allow more dead code to be eliminated.Ah yes, this is a known issue. We use TRIM_UNUSED_KSYMS with LTO in Android's Generic Kernel Image and the problem is that bitcode doesn't yet contain calls to these functions, so autoksyms won't see them. The solution is to use a symbol whitelist with LTO to prevent these from being trimmed. I suspect we would need a default whitelist for LTO builds.
A built-in allowlist sounds good to me. FWIW, in the randconfigs so far, I only
saw five symbols that would need to be on it:
memcpy(), memmove(), memset(), __stack_chk_fail() and __stack_chk_guard
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel