Skip to content

Commit a822771

Browse files
author
Herton R. Krzesinski
committed
Merge: Fix kselftests build after changes from bz2162116 (ipv4 backports)
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2009 Unfortunately the uapi headers changes done through bz2162116 broke kernel builds. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2166738 Any kernel build using kernel-headers-5.14.0-253.el9 will fail when building kselftests. The reason is that a new macro used in the headers are not included through other header files, upstream doesn't see the error because the definition is included indirectly there. I identified the commit which fixes this upstream, and made the kselftests build process try to really use the headers from the source tree. Hopefully this prevents us to hit a problem like this in the future. It was also necessary to anyway include <linux/stddef.h> in ip.h/ipv6.h headers, because at least one bpf selftest required it. Signed-off-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: Andrea Claudi <aclaudi@redhat.com> Approved-by: Guillaume Nault <gnault@redhat.com> Approved-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents a83967a + 8facdd4 commit a822771

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

include/uapi/linux/byteorder/big_endian.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define __BIG_ENDIAN_BITFIELD
1010
#endif
1111

12+
#include <linux/stddef.h>
1213
#include <linux/types.h>
1314
#include <linux/swab.h>
1415

include/uapi/linux/byteorder/little_endian.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define __LITTLE_ENDIAN_BITFIELD
1010
#endif
1111

12+
#include <linux/stddef.h>
1213
#include <linux/types.h>
1314
#include <linux/swab.h>
1415

include/uapi/linux/ip.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef _UAPI_LINUX_IP_H
1919
#define _UAPI_LINUX_IP_H
2020
#include <linux/types.h>
21+
#include <linux/stddef.h>
2122
#include <asm/byteorder.h>
2223

2324
#define IPTOS_TOS_MASK 0x1E

include/uapi/linux/ipv6.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <linux/libc-compat.h>
66
#include <linux/types.h>
7+
#include <linux/stddef.h>
78
#include <linux/in6.h>
89
#include <asm/byteorder.h>
910

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)