From: Artem Savkov on gitlab.com Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2884
Forwardport from rhel9.
Bugzilla: http://bugzilla.redhat.com/2120968 Upstream status: RHEL-only
With the latest toolchain update build fails due to libbpf missing btf enum64 support. 5.19 update contains libbpf update but the spec uses buildroot's (old) bpftool.
Switch to use the just-built bpftool.
The snippet cannot be moved below bpftool build since vmlinux.h is needed to build_tools.
Credits to Felix Maurer fmaurer@redhat.com
Signed-off-by: Yauheni Kaliuta ykaliuta@redhat.com
--- redhat/kernel.spec.template | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
From: Yauheni Kaliuta ykaliuta@redhat.com
spec: use just-built bpftool for vmlinux.h generation
Bugzilla: http://bugzilla.redhat.com/2120968 Upstream status: RHEL-only
With the latest toolchain update build fails due to libbpf missing btf enum64 support. 5.19 update contains libbpf update but the spec uses buildroot's (old) bpftool.
Switch to use the just-built bpftool.
The snippet cannot be moved below bpftool build since vmlinux.h is needed to build_tools.
Credits to Felix Maurer fmaurer@redhat.com
Signed-off-by: Yauheni Kaliuta ykaliuta@redhat.com
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -666,9 +666,6 @@ BuildRequires: kernel-rpm-macros # glibc-static is required for a consistent build environment (specifically # CONFIG_CC_CAN_LINK_STATIC=y). BuildRequires: glibc-static -%ifnarch %{nobuildarches} noarch -BuildRequires: bpftool -%endif %if %{with_headers} BuildRequires: rsync %endif @@ -2610,7 +2607,9 @@ BuildKernel() { # Generate vmlinux.h and put it to kernel-devel path # zfcpdump build does not have btf anymore if [ "$Variant" != "zfcpdump" ]; then - bpftool btf dump file vmlinux format c > $RPM_BUILD_ROOT/$DevelDir/vmlinux.h + # Build the bootstrap bpftool to generate vmlinux.h + make -C tools/bpf/bpftool bootstrap + tools/bpf/bpftool/bootstrap/bpftool btf dump file vmlinux format c > $RPM_BUILD_ROOT/$DevelDir/vmlinux.h fi
# prune junk from kernel-devel
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2884
From: Artem Savkov asavkov@redhat.com
redhat/spec: use distro CFLAGS when building bootstrap bpftool
Use distro HOST{CFLAGS,LDFLAGS} when building bootstrap bpftool.
Signed-off-by: Artem Savkov asavkov@redhat.com
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -2608,7 +2608,10 @@ BuildKernel() { # zfcpdump build does not have btf anymore if [ "$Variant" != "zfcpdump" ]; then # Build the bootstrap bpftool to generate vmlinux.h - make -C tools/bpf/bpftool bootstrap + export BPFBOOTSTRAP_CFLAGS=$(echo "%{__global_compiler_flags}" | sed -r "s/-specs=[^\ ]+/redhat-annobin-cc1//") + export BPFBOOTSTRAP_LDFLAGS=$(echo "%{__global_ldflags}" | sed -r "s/-specs=[^\ ]+/redhat-annobin-cc1//") + CFLAGS="" LDFLAGS="" make EXTRA_CFLAGS="${BPFBOOTSTRAP_CFLAGS}" EXTRA_LDFLAGS="${BPFBOOTSTRAP_LDFLAGS}" %{?make_opts} %{?clang_make_opts} V=1 -C tools/bpf/bpftool bootstrap + tools/bpf/bpftool/bootstrap/bpftool btf dump file vmlinux format c > $RPM_BUILD_ROOT/$DevelDir/vmlinux.h fi
@@ -2665,7 +2668,6 @@ mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
cd linux-%{KVERREL}
- %if %{with_debug} %if %{with_realtime} echo "building rt-debug"
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2884
From: Patrick Talbert on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2884#note_1755301...
Thank you @artem.savkov . Just FYI, kernel-ark project MRs do not use or recognize Bugzilla & JIRA tags.
kernel@lists.fedoraproject.org