Accepting request 960937 from home:jeff_mahoney:branches:devel:libraries:c_c++

- Enable building and packaging of static library.
  Explicitly enable fat LTO objects.

Enabling fat LTO to get successful builds on ppc64.
Now removed commented out removal of rm command.

OBS-URL: https://build.opensuse.org/request/show/960937
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libbpf?expand=0&rev=16
This commit is contained in:
Michał Rostecki 2022-03-11 13:42:38 +00:00 committed by Git OBS Bridge
parent 5149d0519a
commit 8c5c35b5f3
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 10 18:28:17 UTC 2022 - Jeff Mahoney <jeffm@suse.com>
- Enable building and packaging of static library.
Explicitly enable fat LTO objects.
-------------------------------------------------------------------
Fri Mar 4 10:18:54 UTC 2022 - Jan Engelhardt <jengelh@inai.de>

View File

@ -48,17 +48,26 @@ Requires: linux-glibc-devel >= 5.16
%description devel
libbpf is a C library which provides API for managing eBPF programs and maps.
%package devel-static
Summary: Static library for libbpf
Requires: %{libname} = %{version}
Requires: %{name}-devel = %{version}
Requires: linux-glibc-devel >= 5.16
%description devel-static
libbpf is a C library which provides API for managing eBPF programs and maps.
%prep
%autosetup
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
cd src
%make_build V=1 CFLAGS="%{optflags}"
%install
cd src
%make_install V=1
rm -f %{buildroot}%{_libdir}/%{name}.a
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
@ -73,4 +82,7 @@ rm -f %{buildroot}%{_libdir}/%{name}.a
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%files devel-static
%{_libdir}/%{name}.a
%changelog