Björn Töpel bjorn@kernel.org writes:
From: Björn Töpel bjorn@rivosinc.com
When the BPF selftests are cross-compiled, only the a host version of bpftool is built. This version of bpftool is used to generate various intermediates, e.g., skeletons.
The test runners are also using bpftool. The Makefile will symlink bpftool from the selftest/bpf root, where the test runners will look for the tool:
| ... | $(Q)ln -sf $(if $2,..,.)/tools/build/bpftool/bootstrap/bpftool \ | $(OUTPUT)/$(if $2,$2/)bpftool
There are two issues for cross-compilation builds:
- There is no native (cross-compilation target) build of bpftool
- The bootstrap variant of bpftool is never cross-compiled (by design)
Make sure that a native/cross-compiled version of bpftool is built, and if CROSS_COMPILE is set, symlink to the native/non-bootstrap version.
...and the grand master plan is to add BPF CI support for riscv64, where this patch a prerequisite to [1]. I would suspect that other platforms might benefit from cross-compilation builds as well.