All of lore.kernel.org
 help / color / mirror / Atom feed
* Can't build 5.13 selftests against clang-12 nor clang-13
@ 2021-07-15  9:03 Lorenz Bauer
  2021-07-15 16:21 ` Yonghong Song
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenz Bauer @ 2021-07-15  9:03 UTC (permalink / raw)
  To: Andrii Nakryiko, Alexei Starovoitov, Daniel Borkmann; +Cc: bpf

Hi everyone,

I'm trying to build 5.13.2 selftests for github.com/cilium/ci-kernels.
With clang-12:

    libbpf: failed to find BTF for extern 'tcp_reno_cong_avoid' [38] section: -2
    Error: failed to open BPF object file: No such file or directory
    libbpf: failed to find BTF for extern 'tcp_cong_avoid_ai' [27] section: -2
    Error: failed to open BPF object file: No such file or directory

Arnaldo has hit this problem before:
https://www.spinics.net/lists/dwarves/msg01332.html So I tried to
recompile with clang-13 (Ubuntu clang version
13.0.0-++20210629083512+c4de78e91c93-1~exp1~20210629184258.496):

    libbpf: ELF relo #0 in section #15 has unexpected type 2 in
/home/lorenz/dev/ci-kernels/build/linux-5.13.2/tools/testing/selftests/bpf/bpf_cubic.o

Aka my clang-12 is too old, my clang-13 is too new. In the past we've
stubbed out some tests based on clang version, can we do the same
here?

This build breakage tends to happen with every major kernel release.
Is there a way to avoid this? FWIW some CI builds fail because of
this, however I have no idea where these reports go / why they aren't
taken into account: https://lkml.org/lkml/2021/6/22/987

It would be nice if there was some combination of (easily available
clang release) x (stable kernel versions) that allows to compile BPF
selftests successfully.

Lorenz

-- 
Lorenz Bauer  |  Systems Engineer
6th Floor, County Hall/The Riverside Building, SE1 7PB, UK

www.cloudflare.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Can't build 5.13 selftests against clang-12 nor clang-13
  2021-07-15  9:03 Can't build 5.13 selftests against clang-12 nor clang-13 Lorenz Bauer
@ 2021-07-15 16:21 ` Yonghong Song
  0 siblings, 0 replies; 2+ messages in thread
From: Yonghong Song @ 2021-07-15 16:21 UTC (permalink / raw)
  To: Lorenz Bauer, Andrii Nakryiko, Alexei Starovoitov, Daniel Borkmann; +Cc: bpf



On 7/15/21 2:03 AM, Lorenz Bauer wrote:
> Hi everyone,
> 
> I'm trying to build 5.13.2 selftests for github.com/cilium/ci-kernels.
> With clang-12:
> 
>      libbpf: failed to find BTF for extern 'tcp_reno_cong_avoid' [38] section: -2
>      Error: failed to open BPF object file: No such file or directory
>      libbpf: failed to find BTF for extern 'tcp_cong_avoid_ai' [27] section: -2
>      Error: failed to open BPF object file: No such file or directory
> 
> Arnaldo has hit this problem before:
> https://www.spinics.net/lists/dwarves/msg01332.html  So I tried to
> recompile with clang-13 (Ubuntu clang version
> 13.0.0-++20210629083512+c4de78e91c93-1~exp1~20210629184258.496):
> 
>      libbpf: ELF relo #0 in section #15 has unexpected type 2 in
> /home/lorenz/dev/ci-kernels/build/linux-5.13.2/tools/testing/selftests/bpf/bpf_cubic.o

In this particular case, you can check out a llvm13 git repo upto but 
not including the patch
    6a2ea84600ba BPF: Add more relocation kinds

> 
> Aka my clang-12 is too old, my clang-13 is too new. In the past we've
> stubbed out some tests based on clang version, can we do the same
> here?

LLVM has 6-month development cycle vs. kernel 8-10 weeks.
With this, sometimes we implemented some features which is suitable
for *latest* kernel version but has an adverse impact on old
kernels.

> 
> This build breakage tends to happen with every major kernel release.
> Is there a way to avoid this? FWIW some CI builds fail because of
> this, however I have no idea where these reports go / why they aren't
> taken into account: https://lkml.org/lkml/2021/6/22/987

First always check tools/testing/selftests/bpf/README.rst which should
contain most, if not all, possible breakages and how to mitigate them,
e.g., which llvm patch is responsible and if you checkout a llvm repo
upto and without that patch, you might be okay.

We can also maintain a list of llvm sha commits which have been tested
to work for a particular kernel version.

Further, if we really want, we could have a forked llvm-project repo
with tags for each kernel release. This way, people can checkout the 
repo/tag and build for particular kernel release selftests.

> 
> It would be nice if there was some combination of (easily available
> clang release) x (stable kernel versions) that allows to compile BPF
> selftests successfully.
> 
> Lorenz
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-15 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  9:03 Can't build 5.13 selftests against clang-12 nor clang-13 Lorenz Bauer
2021-07-15 16:21 ` Yonghong Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.