Skip to content

bpf: libbpf fix, pahole update and move to community

Dominique Martinet requested to merge martinetd/aports:pahole_community into master

This probably should be two separate MRs but they depend on each other and I don't know how to do that in gitlab... Please ask if you'd like me to split it.

The first part is a follow-up to #13338 (closed) -- I thought updating the header was enough (it was enough to pass the simple echo '#include <bpf/btf.h>' | gcc -xc -c -o /dev/null - test), but it wasn't as two conflicting versions of the header were installed and libbpf users were confused.

It might be possible to fix all users, but this is a recurrent problem everytime libbpf gets updated, so we might as well just bite the bullet and use their header -- as linux uapi it's compatible even if the version is "too new".

Here's an example error I got without this:

.../aports/community/pahole/src/pahole-v1.23/btf_encoder.c:146:10:
error: array index in initializer exceeds array bounds
  146 |         [BTF_KIND_TYPE_TAG]     = "TYPE_TAG",
      |          ^~~~~~~~~~~~~~~~~
.../aports/community/pahole/src/pahole-v1.23/btf_encoder.c:146:10:
note: (near initialization for 'btf_kind_str')

which is impressive, because the bounds are defined in the same header with NR_BPF_KINDS at the end of the enum, so you'd expect that if BTF_KIND_TYPE_TAG is defined the max would also correspond to the version of the header that defines it... Except it doesn't.

The second part is just updating pahole and moving it to community, which is a first step towards #12563 (closed)

Edited by Dominique Martinet

Merge request reports

Loading