From: Gregory Bell <grb...@redhat.com>

redhat/spec: Fix samples/bpf build

Bpftool is built from debuginfo so pass previously built bpftool
to samples/bpf Makefile instead of rebuilding during the samples/bpf make 
process

Pass RPM_OPT_FLAGS and __global_ldflags to samples/bpf Makefile to ensure all
build options are propagated properly

Fix vmlinux.h path by adding prefix $RPM_BUILD_ROOT

Signed-off-by: Gregory Bell <grb...@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
@@ -3148,8 +3148,8 @@ pushd tools/tracing/rtla
 popd
 %endif
 
-if [ -f $DevelDir/vmlinux.h ]; then
-  RPM_VMLINUX_H=$DevelDir/vmlinux.h
+if [ -f $RPM_BUILD_ROOT$DevelDir/vmlinux.h ]; then
+  RPM_VMLINUX_H=$RPM_BUILD_ROOT$DevelDir/vmlinux.h
 fi
 echo "${RPM_VMLINUX_H}" > ../vmlinux_h_path
 
@@ -3170,7 +3170,7 @@ if [ ! -f include/generated/autoconf.h ]; then
 fi
 
 %{log_msg "build samples/bpf"}
-%{make} %{?_smp_mflags} EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" ARCH=$Arch V=1 
M=samples/bpf/ VMLINUX_H="${RPM_VMLINUX_H}" || true
+%{make} %{?_smp_mflags} EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" 
TPROGS_USER_CFLAGS="${RPM_OPT_FLAGS}" TPROGS_USER_LDFLAGS="%{__global_ldflags}" 
BPFTOOL=$(pwd)/tools/bpf/bpftool/bootstrap/bpftool ARCH=$Arch V=1 
M=samples/bpf/ VMLINUX_H="${RPM_VMLINUX_H}" || true
 
 pushd tools/testing/selftests
 # We need to install here because we need to call make with ARCH set which

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3738

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