Enable LTO

Related: RHEL-30627

By default, Fedora's libbpf has LTO turned off (probably for historical
reasons). Since RHEL has more strict hardening checks, we need to enable
it.

Signed-off-by: Viktor Malik <vmalik@redhat.com>
This commit is contained in:
Viktor Malik 2024-05-16 17:24:37 +02:00
parent b3cd568953
commit 2611bfa4ba
No known key found for this signature in database
GPG Key ID: AF7A2E1F6EE74FB3

View File

@ -9,7 +9,7 @@
Name: libbpf
Version: 1.4.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Libbpf library
License: LGPL-2.1-only OR BSD-2-Clause
@ -45,8 +45,6 @@ Requires: %{name}-devel = 2:%{version}-%{release}
The %{name}-static package contains static library for
developing applications that use %{name}
%define _lto_cflags %{nil}
%global libbpf_make \
make prefix=%{_prefix} DESTDIR=%{buildroot} OBJDIR=%{_builddir} CFLAGS="%{build_cflags} -fPIC" LDFLAGS="%{build_ldflags} -Wl,--no-as-needed" LIBDIR=/%{_libdir} NO_PKG_CONFIG=1