Skip to content

Commit 63f076b

Browse files
author
Herton R. Krzesinski
committed
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>
1 parent 93c0e8f commit 63f076b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redhat/kernel.spec.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,7 @@ export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool
23232323
pushd tools/testing/selftests
23242324
# We need to install here because we need to call make with ARCH set which
23252325
# doesn't seem possible to do in the install section.
2326-
%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf vm livepatch net net/forwarding net/mptcp netfilter tc-testing memfd" SKIP_TARGETS="" FORCE_TARGETS=1 INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}" install
2326+
%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf vm livepatch net net/forwarding net/mptcp netfilter tc-testing memfd" SKIP_TARGETS="" FORCE_TARGETS=1 INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}" DEFAULT_INSTALL_HDR_PATH=0 install
23272327

23282328
# 'make install' for bpf is broken and upstream refuses to fix it.
23292329
# Install the needed files manually.

0 commit comments

Comments
 (0)