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>
Resolves: RHEL-30627
RHEL packaging of libbpf differs from the Fedora one as in RHEL, we are
building libbpf directly from the kernel source tree (not GitHub repo).
Therefore, the "source" is the corresponding kernel tarball.
The reason for this difference is that BPF selftests (the only way of
testing libbpf) are not able to work with system-wide libbpf (i.e. the
one we would build from GitHub).
The changes to specfile are mostly taken from the c9s specfile, with
some minor changes.
Signed-off-by: Viktor Malik <vmalik@redhat.com>
Adding the -fPIC also for static objects, so it can
be used in builds with shared libraries.
There's old guide (draft) for Fedora (only one I could find):
https://fedoraproject.org/wiki/User:Ajax/Static_Library_PICness_Guidelines
saying:
Packages that install static library archives (.a files) must do exactly one of:
- build them as PIC objects
- document why the static libraries are not built PIC AND receive explicit approval from FESCo.
- build both PIC and non-PIC libraries, with a .pc file for each for dependent packages to use
If we ever want/need nonpic archive, we will go with 3rd option above,
for now just enabling fPIC in libbpf.a
This reverts commit 5e3400bb52,
and gets back to 0.0.3 release, because the needed v5.4
kernel is not released yet and we need to wait for that
before we release 0.0.5 (fixes BZ#1755317).
Increasing Epoch to get over 0.0.5.
libbpf is not backwards compile compatible,
so we need to make devel package dependent
on relevant kernel-headers package.
It's 5.4.0-1 for 0.0.5 version.