[OS-BUILD PATCH 1/2] spec: pass HOSTCFLAGS/HOSTLDFLAGS as env vars to make

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Viktor Malik <vmalik@xxxxxxxxxx>

spec: pass HOSTCFLAGS/HOSTLDFLAGS as env vars to make

Upstream commit 56a2df7615fa ("tools/resolve_btfids: Compile
resolve_btfids as host program") changed the 'resolve_btfids' tool to be
built as a host program. This causes selftests compilation error as we
override HOSTCFLAGS when calling 'make' from the specfile, effectively
supressing the effect of HOSTCFLAGS update in
tools/bpf/resolve_btfids/Makefile. See [1] for details why this happens.

This patch fixes the above error by passing HOSTCGLAGS and HOSTLDFLAGS
through environment variables rather than through the make command.

[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html

Signed-off-by: Viktor Malik <vmalik@xxxxxxxxxx>

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
@@ -1728,7 +1728,7 @@ cp_vmlinux()
 %define build_hostldflags %{?build_ldflags}
 %endif
 
-%define make %{__make} %{?cross_opts} %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"
+%define make HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}" %{__make} %{?cross_opts} %{?make_opts}
 
 InitBuildVars() {
     # Initialize the kernel .config file and create some variables that are

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux