On Wed, Apr 26, 2023 at 3:07 PM Daniel Rosenberg drosen@google.com wrote:
It is expected that you build the freshest vmlinux image before building selftests, because we generate vmlinux.h from it. In your case we generated vmlinux.h from your system-wide /sys/kernel/btf/vmlinux BTF information, which doesn't yet have latest UAPI enums.
I'm still unable to build the selftests. I've got it pointed to a locally built kernel built using the config/config.x86_64, and have tried running the vmtest.sh script, and building just the tests via make. I'm using O= to direct it to the out directory for the kernel build. I've been hitting various errors when trying this. Confusingly the error message isn't always the same. Currently from a clean build, it complains about "linux/atomic.h" not found via #include "../../../include/linux/filter.h"'s in various files. Other times it's complained about the various helper functions from bpf_helper_defs.h being unused.
I'm not sure if I'm invoking the command wrong, or missing dependencies or something. I got past some earlier issues by updating clang. Any idea what I'm doing wrong?
Don't know, show the sequence of commands you are running?
I have linux source in ~/linux, and KBUILD_OUTPUT set to ~/linux-build/default. And it only takes this:
$ cd ~/linux $ make -j90 # build kernel $ cd tools/testing/selftests/bpf $ make -j90 # build selftests
And that's it.