From: Yauheni Kaliuta <ykali...@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 <fmau...@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykali...@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
--
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to