Subject: Re: linux-next failing build due to missing cubictcp_state symbol

From: Florian Weimer <[email-masked]>
Date: Fri, 07 May 2021 09:10:05 +0200

* Jiri Slaby:

> The dot makes the difference, of course. The question is why is it
> there? I keep looking into it. Only if someone has an immediate
> idea...

We see the failure on aarch64 as well, with 8404c9fbc84b741
(from Linus' tree).

As far as I can tell, the core issue is that BTF_ID is applied to a
symbol which is defined as static on the C side (and even in a different
translation unit, but this aspect doesn't really matter).  The compiler
can and will change symbol names, calling conventions and data layout
for static functions/variables, so this is never going to work reliably.
It is possible to inhibit these optimizations by using __attribute__
((used)).  But I'm pretty sure that BTF generation fails to work
properly if there are symbol name collisions, so I think it's better to
drop the static and rely on duplicate symbol checks from the linker
(which of course does not happen for C entities declared static).

Thanks,
Florian