You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
redhat: make selftests build install headers under tools/testing/selftests/usr/include
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2166738
Upstream Status: RHEL only
As can be seen from the build output of selftests, it tries to use the current headers
under tools/testing/selftests/usr/include
...
make[1]: Entering directory '/(...)/centos-stream-9/tools/testing/selftests/bpf'
clang -g -Werror -D__TARGET_ARCH_x86 -mlittle-endian
-I/(...)/centos-stream-9/tools/testing/selftests/bpf/tools/include
-I/(...)/centos-stream-9/tools/testing/selftests/bpf
-I/(...)/centos-stream-9/tools/include/uapi
-I/(...)/centos-stream-9/tools/testing/selftests/usr/include
-idirafter /usr/lib64/clang/15.0.1/include -idirafter /usr/local/include -idirafter /usr/include
-Wno-compare-distinct-pointer-types -DENABLE_ATOMICS_TESTS -O2 -target bpf
-c progs/cg_storage_multi_shared.c -mcpu=v3
-o /(...)/centos-stream-9/tools/testing/selftests/bpf/cg_storage_multi_shared.o
...
However, when building without O=/KBUILD_OUTPUT= set, make doesn't install the uapi
headers from the source tree under tools/testing/selftests/, so the include above
using -I/(...)/centos-stream-9/tools/testing/selftests/usr/include does not work.
It falls back to the installed kernel-headers on the system. And if the installed
headers are outdated, build can fail, even if we patch the header like in the previous
commit. Specifying DEFAULT_INSTALL_HDR_PATH=0 tells the Makefile to end up installing
the uapi headers also at (...)/tools/testing/selftests directory, which we use here
as a workaround so kselftests can use it to get the latest header version.
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
0 commit comments