From ecfeaf969f412a5e130c955feca846ca5bdf3bd8 Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Thu, 3 Nov 2022 13:51:49 +0100 Subject: [PATCH] a8a fixes --- SOURCES/linux-5.14.0-headers-fix.patch | 23 +++++++++++++++++++++++ SPECS/kernel.spec | 13 +++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 SOURCES/linux-5.14.0-headers-fix.patch diff --git a/SOURCES/linux-5.14.0-headers-fix.patch b/SOURCES/linux-5.14.0-headers-fix.patch new file mode 100644 index 0000000..722367c --- /dev/null +++ b/SOURCES/linux-5.14.0-headers-fix.patch @@ -0,0 +1,23 @@ +diff -Naur linux-5.14.0-70.30.1.el9_0/tools/testing/selftests/memfd/memfd_test.c linux-5.14.0-70.30.1.el9_0.alma/tools/testing/selftests/memfd/memfd_test.c +--- linux-5.14.0-70.30.1.el9_0/tools/testing/selftests/memfd/memfd_test.c 2022-10-14 13:02:21.000000000 +0000 ++++ linux-5.14.0-70.30.1.el9_0.alma/tools/testing/selftests/memfd/memfd_test.c 2022-11-03 12:45:19.583010255 +0000 +@@ -6,7 +6,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff -Naur linux-5.14.0-70.30.1.el9_0/tools/testing/selftests/vm/userfaultfd.c linux-5.14.0-70.30.1.el9_0.alma/tools/testing/selftests/vm/userfaultfd.c +--- linux-5.14.0-70.30.1.el9_0/tools/testing/selftests/vm/userfaultfd.c 2022-10-14 13:02:21.000000000 +0000 ++++ linux-5.14.0-70.30.1.el9_0.alma/tools/testing/selftests/vm/userfaultfd.c 2022-11-03 12:46:20.128372395 +0000 +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec index d81ced6..5c13834 100755 --- a/SPECS/kernel.spec +++ b/SPECS/kernel.spec @@ -568,7 +568,7 @@ BuildRequires: gcc-plugin-devel # glibc-static is required for a consistent build environment (specifically # CONFIG_CC_CAN_LINK_STATIC=y). BuildRequires: glibc-static -BuildRequires: kernel-rpm-macros >= 185-9 +BuildRequires: kernel-rpm-macros >= 125 %ifnarch %{nobuildarches} noarch BuildRequires: bpftool %endif @@ -805,6 +805,8 @@ Source4002: gating.yaml Patch1: patch-%{rpmversion}-redhat.patch %endif +Patch2: linux-5.14.0-headers-fix.patch + # empty final patch to facilitate testing of kernel patches Patch999999: linux-kernel-test.patch @@ -1344,6 +1346,7 @@ cp -a %{SOURCE1} . ApplyOptionalPatch patch-%{rpmversion}-redhat.patch %endif +ApplyOptionalPatch linux-5.14.0-headers-fix.patch ApplyOptionalPatch linux-kernel-test.patch # END OF PATCH APPLICATIONS @@ -2154,9 +2157,10 @@ chmod +x tools/perf/check-headers.sh %endif %global tools_make \ - %{make} CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" %{?make_opts} + %{make} CFLAGS="${RPM_OPT_FLAGS}" -D_GNU_SOURCE -isystem ${USR_INC}" LDFLAGS="%{__global_ldflags}" %{?make_opts} %if %{with_tools} +export USR_INC=$(pwd)/usr/include %ifarch %{cpupowerarchs} # cpupower # make sure version-gen.sh is executable. @@ -2199,7 +2203,7 @@ if [ -f $DevelDir/vmlinux.h ]; then fi %global bpftool_make \ - %{__make} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_LDFLAGS="%{__global_ldflags}" DESTDIR=$RPM_BUILD_ROOT %{?make_opts} VMLINUX_H="${RPM_VMLINUX_H}" V=1 + %{__make} EXTRA_CFLAGS="${RPM_OPT_FLAGS} -isystem ${USR_INC}"" EXTRA_LDFLAGS="%{__global_ldflags}" DESTDIR=$RPM_BUILD_ROOT %{?make_opts} VMLINUX_H="${RPM_VMLINUX_H}" V=1 %if %{with_bpftool} pushd tools/bpf/bpftool %{bpftool_make} @@ -2227,7 +2231,7 @@ export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool pushd tools/testing/selftests # We need to install here because we need to call make with ARCH set which # doesn't seem possible to do in the install section. -%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf 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 +%{make} %{?_smp_mflags} EXTRA_CFLAGS="-isystem ${USR_INC}" ARCH=$Arch V=1 TARGETS="bpf 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 # 'make install' for bpf is broken and upstream refuses to fix it. # Install the needed files manually. @@ -2423,6 +2427,7 @@ rm -rf %{buildroot}%{_libdir}/traceevent %endif %if %{with_tools} +export USR_INC=$(pwd)/usr/include %ifarch %{cpupowerarchs} %{make} -C tools/power/cpupower DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install rm -f %{buildroot}%{_libdir}/*.{a,la}