From: Artem Savkov <[email protected]>

redhat/spec: use distro CFLAGS when building bootstrap bpftool

Use distro HOST{CFLAGS,LDFLAGS} when building bootstrap bpftool.

Signed-off-by: Artem Savkov <[email protected]>

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
--
_______________________________________________
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