From 271209bec1fdb37266dfd7dab504ac02294fd34d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 21 2020 22:40:48 +0000 Subject: import libbpf-0.0.4-3.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a958db --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/linux-4.18.0-167.el8.tar.xz diff --git a/.libbpf.metadata b/.libbpf.metadata new file mode 100644 index 0000000..4058436 --- /dev/null +++ b/.libbpf.metadata @@ -0,0 +1 @@ +5d85dc56d6a793428d6a453a53793a56eea42498 SOURCES/linux-4.18.0-167.el8.tar.xz diff --git a/SOURCES/0001-fix-i686-compilation.patch b/SOURCES/0001-fix-i686-compilation.patch new file mode 100644 index 0000000..baf9299 --- /dev/null +++ b/SOURCES/0001-fix-i686-compilation.patch @@ -0,0 +1,25 @@ +From 31bf12c3bbe6ef6b32b9553db723bf3156ef1099 Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Sat, 14 Dec 2019 15:57:41 +0100 +Subject: [PATCH] fix i686 compilation + +--- + tools/lib/bpf/libbpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c +index bcd5631a4fed..4bb6ebfecb20 100644 +--- a/tools/lib/bpf/libbpf.c ++++ b/tools/lib/bpf/libbpf.c +@@ -1790,7 +1790,7 @@ static int bpf_program__record_reloc(struct bpf_program *prog, + return -LIBBPF_ERRNO__RELOC; + } + if (sym->st_value % 8) { +- pr_warn("bad call relo offset: %lu\n", sym->st_value); ++ pr_warn("bad call relo offset: %zu\n", (size_t) sym->st_value); + return -LIBBPF_ERRNO__RELOC; + } + reloc_desc->type = RELO_CALL; +-- +2.21.1 + diff --git a/SPECS/libbpf.spec b/SPECS/libbpf.spec new file mode 100644 index 0000000..3ad8e4b --- /dev/null +++ b/SPECS/libbpf.spec @@ -0,0 +1,81 @@ +# We build libbpf from RHEL kernel sources, that's why we use +# directly kernel tar for RHEL kernel build. +# We update libbpf's 'sources' file with proper hash that's +# used as kernel tar. + +# RHEL kernel version-release +%define kver 4.18.0-167 +%define source linux-%{kver}.el8 + +Name: libbpf +Version: 0.0.4 +Release: 3%{?dist} +Summary: Libbpf library + +License: LGPLv2 or BSD +Source0: %{source}.tar.xz +Patch0: 0001-fix-i686-compilation.patch +BuildRequires: gcc elfutils-libelf-devel elfutils-devel python3 + +%description +A mirror of bpf-next linux tree bpf-next/tools/lib/bpf directory plus its +supporting header files. The version of the package reflects the version of +ABI. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} +Requires: kernel-headers >= %{kver} + +%description devel +The %{name}-devel package contains libraries header files for +developing applications that use %{name} + +%package static +Summary: Static library for libbpf development +Requires: %{name}-devel = %{version}-%{release} + +%description static +The %{name}-static package contains static library for +developing applications that use %{name} + +%global libbpf_make \ + make EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_LDFLAGS="%{__global_ldflags}" DESTDIR=%{buildroot} V=1 + +%prep +%setup -n %{source} +%patch0 -p1 + +%build +pushd tools/lib/bpf +%{libbpf_make} +popd + +%install +pushd tools/lib/bpf +%{libbpf_make} prefix=%{_prefix} install_lib install_headers +popd + +%files +%{_libdir}/libbpf.so.%{version} +%{_libdir}/libbpf.so.0 + +%files devel +%{_libdir}/libbpf.so +%{_includedir}/bpf + +%files static +%{_libdir}/libbpf.a + +%changelog +* Sun Dec 15 2019 Jiri Olsa - 0.0.4-3 +- new kernel version [1759154] + +* Tue Dec 10 2019 Jiri Olsa - 0.0.4-2 +- new build for gating [1759154] + +* Mon Nov 02 2019 Jiri Olsa - 0.0.4-1 +- version 0.0.4 [1759154] + +* Mon Nov 02 2019 Jiri Olsa - 0.0.2-1 +- initial package [1759154]