lkml.org 
[lkml]   [2020]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v8 00/16] Add support for Clang LTO
On Wed, Dec 9, 2020 at 4:36 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Tue, Dec 8, 2020 at 1:15 PM Arnd Bergmann <arnd@kernel.org> wrote:
> >
> > - one build seems to have dropped all symbols the string operations
> > from vmlinux,
> > so while the link goes through, modules cannot be loaded:
> > ERROR: modpost: "memmove" [drivers/media/rc/rc-core.ko] undefined!
> > ERROR: modpost: "memcpy" [net/wireless/cfg80211.ko] undefined!
> > ERROR: modpost: "memcpy" [net/8021q/8021q.ko] undefined!
> > ERROR: modpost: "memset" [net/8021q/8021q.ko] undefined!
> > ERROR: modpost: "memcpy" [net/unix/unix.ko] undefined!
> > ERROR: modpost: "memset" [net/sched/cls_u32.ko] undefined!
> > ERROR: modpost: "memcpy" [net/sched/cls_u32.ko] undefined!
> > ERROR: modpost: "memset" [net/sched/sch_skbprio.ko] undefined!
> > ERROR: modpost: "memcpy" [net/802/garp.ko] undefined!
> > I first thought this was related to a clang-12 bug I saw the other day, but
> > this also happens with clang-11
>
> 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.

Sami

\
 
 \ /
  Last update: 2020-12-09 17:28    [W:0.131 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site