iovisor / iovisor/bcc

Building with CMAKE_USE_LIBBPF_PACKAGE requires v5.17 kernel headers (for struct bpf_core_relo)

Open
#4,014 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

For reasons unrelated to bcc itself (https://github.com/iovisor/bpftrace/issues/2173 ) I have been trying to compile bcc using the CMAKE_USE_LIBBPF_PACKAGE.

Currently this is failing to build for me (bcc-0.24, libbpf-0.7, kernel headers v5.15). The cause is the combination of v5.15 headers and https://github.com/iovisor/bcc/commit/9fce5059307c2f7ea42c2a7e4fee4c1bd82e0b7e . That's because the newly vendored code evaluates sizeof(struct bpf_core_relo) and these structures were not introduced until the v5.17 kernel headers.

Currently I am using the following workaround:
https://github.com/kraj/meta-clang/pull/613/files/3b8d04d0e16f91f7983af7476321f932b1302e52#diff-506de8fdad35abe61aa0e0fb90bf8fd0babe71717fa6cb5055dedc967013fe80

I'd originally assumed this isn't applicable upstream... but then I realized the C++ namespacing might mean its perfectly find to vendor header code like this!

Is this kind of change suitable for bcc or is there a better solution?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.