From: Gregory Bell on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3738#note_2400785759

For RPM_VMLINUX_H vmlinux.h is being output here
`tools/bpf/bpftool/bootstrap/bpftool btf dump file vmlinux format c >
$RPM_BUILD_ROOT/$DevelDir/vmlinux.h` previously no build would see it when
checking this condition so RPM_VMLINUX_H was always an empty variable

```
if [ -f $DevelDir/vmlinux.h ]; then
  RPM_VMLINUX_H=$DevelDir/vmlinux.h
```

Context for where vmlinux.h is generated:
```
%if %{with_debuginfo}
    # Generate vmlinux.h and put it to kernel-devel path
    # zfcpdump build does not have btf anymore
    if [ "$Variant" != "zfcpdump" ]; then
        %{log_msg "Build the bootstrap bpftool to generate vmlinux.h"}
        # Build the bootstrap bpftool to generate vmlinux.h
        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_CXXFLAGS="${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
%endif
```

For bpftool in RHEL-10.0 there is an
[issue](https://issues.redhat.com/browse/RHEL-70466?filter=-1) when building
bpftool that is resolved if we pass the already built bpftool (built in the
section above). I liked this solution because it fixed and optimized it.

-- 
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
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/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to