Accepting request 921765 from home:shunghsiyu:branches:devel:libraries:c_c++

- Update to 0.5.0:
  + New features and user-space APIs:
    - libbpf_set_strict_mode() allowing to opt-in into backwards incompatible libbpf-1.0 changes. See "Libbpf: the road to 1.0" and "Libbpf 1.0 migration guide" for more details.
    - streamlined error reporting for low-level APIs, high-level error-returning APIs, and pointer-returning APIs (as a libbpf-1.0 opt-in);
    - "Light" BPF skeleton support;
    - BPF_PROG_TYPE_SYSCALL support;
    - BPF perf link support for kprobe, uprobe, tracepoint, and perf_event BPF programs;
    - BPF cookie support for kprobe, uprobe, tracepoint, and perf_event BPF programs through bpf_program__attach_[ku]probe_opts() APIs;
    - allow to specify ref_ctr_off for USDT semaphores through bpf_program__attach_uprobe_opts() API;
    - btf_custom_path support in bpf_object_open_opts, allowing to specify custom BTF for CO-RE relocations;
    - sk_reuseport/migrate program type support;
    - btf_dump__dump_type_data() API, allowing to dump binary data according to BTF type description;
    - btf__load_into_kernel() and btf__load_from_kernel_by_id(), and split BTF variants of them;
    - btf__load_vmlinux_btf() and btf__load_module_btf() APIs;
    - bpf_map__initial_value() API to get initial value of mmap-ed BPF maps;
    - bpf_map_lookup_and_delete_elem_flags() API.
  + BPF-side APIs and features:
    - support for weak typed __ksym externs;
    - BPF timer helpers: bpf_timer_init(), bpf_timer_set_callback(), bpf_timer_start(), bpf_timer_cancel();
    - bpf_get_attach_cookie() helper to get BPF cookie from BPF program side;
    - bpf_get_func_ip() helper;
    - bpf_sys_bpf() helper;
    - bpf_task_pt_regs() helper;
    - bpf_btf_find_by_name_kind() helper;
    - usability improvements for bpf_tracing.h when target architecture is missing.
  + Bug fixes and compatibility improvements:
    - improve BPF support detection on old Red Hat kernels with backported BPF patches;
    - improvements for LTO builds with GCC 10+;
    - pass NLM_F_EXCL when creating TC qdisc;
    - better support of BPF map reuse on old kernels;
    - fix the bug resulting in sometimes closing FD 0, which wasn't created and owned by libbpf itself.
- Remove patches merged upstream
  + libdir.patch
  + libbpf-Fix-build-with-latest-gcc-binutils-with-LTO.patch

OBS-URL: https://build.opensuse.org/request/show/921765
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libbpf?expand=0&rev=11
This commit is contained in:
Michał Rostecki 2021-09-27 13:57:21 +00:00 committed by Git OBS Bridge
parent bbb037c275
commit 9146349710
6 changed files with 42 additions and 142 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:21cbee4df093e7fd29e76ed429650d3f3abe3a893f35e346ab9bc3484f6e68c0
size 1015782

3
libbpf-0.5.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5b27980ceab9a80b6f28d3e67b51cea526fda49bd13151ba966e33548feb4f4
size 815083

View File

@ -1,98 +0,0 @@
From acc7f8895899a7a1281d27983ce807e3f7b831ce Mon Sep 17 00:00:00 2001
From: Patrick McCarty <patrick.mccarty@intel.com>
Date: Sun, 3 Jan 2021 06:35:18 +0000
Subject: [PATCH] Fix build with latest gcc/binutils with LTO
After updating to binutils 2.35, the build began to fail with an
assembler error. A bug was opened on the Red Hat Bugzilla a few days
later for the same issue.
Work around the problem by using the new `symver` attribute (introduced
in GCC 10) as needed, instead of the `COMPAT_VERSION` and
`DEFAULT_VERSION` macros, which expand to assembler directives.
Fixes: https://github.com/libbpf/libbpf/issues/338
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1863059
Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1188749
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Make the change conditional on GCC version
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
src/libbpf_internal.h | 23 +++++++++++++++++------
src/xsk.c | 4 ++--
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/libbpf_internal.h b/src/libbpf_internal.h
index f7b691d..fc7c8c6 100644
--- a/src/libbpf_internal.h
+++ b/src/libbpf_internal.h
@@ -87,20 +87,31 @@
(offsetof(TYPE, FIELD) + sizeof(((TYPE *)0)->FIELD))
#endif
+#ifdef __GNUC__
+# if __GNUC__ >= 10
+# define DEFAULT_VERSION(internal_name, api_name, version) \
+__attribute__((__symver__(#api_name "@@" #version)))
+# define COMPAT_VERSION(internal_name, api_name, version) \
+__attribute__((__symver__(#api_name "@" #version)))
+# endif
+#endif
+
+#if ! defined(COMPAT_VERSION) || ! defined(DEFAULT_VERSION)
/* Symbol versioning is different between static and shared library.
* Properly versioned symbols are needed for shared library, but
* only the symbol of the new version is needed for static library.
*/
-#ifdef SHARED
-# define COMPAT_VERSION(internal_name, api_name, version) \
+# ifdef SHARED
+# define COMPAT_VERSION(internal_name, api_name, version) \
asm(".symver " #internal_name "," #api_name "@" #version);
-# define DEFAULT_VERSION(internal_name, api_name, version) \
+# define DEFAULT_VERSION(internal_name, api_name, version) \
asm(".symver " #internal_name "," #api_name "@@" #version);
-#else
-# define COMPAT_VERSION(internal_name, api_name, version)
-# define DEFAULT_VERSION(internal_name, api_name, version) \
+# else
+# define COMPAT_VERSION(internal_name, api_name, version)
+# define DEFAULT_VERSION(internal_name, api_name, version) \
extern typeof(internal_name) api_name \
__attribute__((alias(#internal_name)));
+# endif
#endif
extern void libbpf_print(enum libbpf_print_level level,
diff --git a/src/xsk.c b/src/xsk.c
index e9b619a..a211169 100644
--- a/src/xsk.c
+++ b/src/xsk.c
@@ -281,6 +281,7 @@ out_mmap:
return err;
}
+DEFAULT_VERSION(xsk_umem__create_v0_0_4, xsk_umem__create, LIBBPF_0.0.4)
int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area,
__u64 size, struct xsk_ring_prod *fill,
struct xsk_ring_cons *comp,
@@ -345,6 +346,7 @@ struct xsk_umem_config_v1 {
__u32 frame_headroom;
};
+COMPAT_VERSION(xsk_umem__create_v0_0_2, xsk_umem__create, LIBBPF_0.0.2)
int xsk_umem__create_v0_0_2(struct xsk_umem **umem_ptr, void *umem_area,
__u64 size, struct xsk_ring_prod *fill,
struct xsk_ring_cons *comp,
@@ -358,8 +360,6 @@ int xsk_umem__create_v0_0_2(struct xsk_umem **umem_ptr, void *umem_area,
return xsk_umem__create_v0_0_4(umem_ptr, umem_area, size, fill, comp,
&config);
}
-COMPAT_VERSION(xsk_umem__create_v0_0_2, xsk_umem__create, LIBBPF_0.0.2)
-DEFAULT_VERSION(xsk_umem__create_v0_0_4, xsk_umem__create, LIBBPF_0.0.4)
static enum xsk_prog get_xsk_prog(void)
{
--
2.32.0

View File

@ -1,3 +1,41 @@
-------------------------------------------------------------------
Mon Sep 27 11:02:49 UTC 2021 - Shung-Hsi Yu <shung-hsi.yu@suse.com>
- Update to 0.5.0:
+ New features and user-space APIs:
- libbpf_set_strict_mode() allowing to opt-in into backwards incompatible libbpf-1.0 changes. See "Libbpf: the road to 1.0" and "Libbpf 1.0 migration guide" for more details.
- streamlined error reporting for low-level APIs, high-level error-returning APIs, and pointer-returning APIs (as a libbpf-1.0 opt-in);
- "Light" BPF skeleton support;
- BPF_PROG_TYPE_SYSCALL support;
- BPF perf link support for kprobe, uprobe, tracepoint, and perf_event BPF programs;
- BPF cookie support for kprobe, uprobe, tracepoint, and perf_event BPF programs through bpf_program__attach_[ku]probe_opts() APIs;
- allow to specify ref_ctr_off for USDT semaphores through bpf_program__attach_uprobe_opts() API;
- btf_custom_path support in bpf_object_open_opts, allowing to specify custom BTF for CO-RE relocations;
- sk_reuseport/migrate program type support;
- btf_dump__dump_type_data() API, allowing to dump binary data according to BTF type description;
- btf__load_into_kernel() and btf__load_from_kernel_by_id(), and split BTF variants of them;
- btf__load_vmlinux_btf() and btf__load_module_btf() APIs;
- bpf_map__initial_value() API to get initial value of mmap-ed BPF maps;
- bpf_map_lookup_and_delete_elem_flags() API.
+ BPF-side APIs and features:
- support for weak typed __ksym externs;
- BPF timer helpers: bpf_timer_init(), bpf_timer_set_callback(), bpf_timer_start(), bpf_timer_cancel();
- bpf_get_attach_cookie() helper to get BPF cookie from BPF program side;
- bpf_get_func_ip() helper;
- bpf_sys_bpf() helper;
- bpf_task_pt_regs() helper;
- bpf_btf_find_by_name_kind() helper;
- usability improvements for bpf_tracing.h when target architecture is missing.
+ Bug fixes and compatibility improvements:
- improve BPF support detection on old Red Hat kernels with backported BPF patches;
- improvements for LTO builds with GCC 10+;
- pass NLM_F_EXCL when creating TC qdisc;
- better support of BPF map reuse on old kernels;
- fix the bug resulting in sometimes closing FD 0, which wasn't created and owned by libbpf itself.
- Remove patches merged upstream
+ libdir.patch
+ libbpf-Fix-build-with-latest-gcc-binutils-with-LTO.patch
-------------------------------------------------------------------
Fri Aug 27 06:20:53 UTC 2021 - Michal Suchanek <msuchanek@suse.com>

View File

@ -19,17 +19,13 @@
%define sover_major 0
%define libname libbpf%{sover_major}
Name: libbpf
Version: 0.4.0
Version: 0.5.0
Release: 0
Summary: C library for managing eBPF programs and maps
License: LGPL-2.1-only
URL: https://github.com/libbpf/libbpf
Source: https://github.com/libbpf/libbpf/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source99: baselibs.conf
# PATCH-FIX-UPSTREAM https://github.com/libbpf/libbpf/issues/337
Patch: libdir.patch
# PATCH-FIX-UPSTREAM https://github.com/libbpf/libbpf/pull/373
Patch1: libbpf-Fix-build-with-latest-gcc-binutils-with-LTO.patch
BuildRequires: libelf-devel
BuildRequires: linux-glibc-devel >= 4.5
BuildRequires: python3

View File

@ -1,36 +0,0 @@
From 6eb5e25905d2258c595d7fc75624c60a357c1c3b Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Sun, 18 Jul 2021 22:05:01 +0200
Subject: [PATCH] Makefile: Default LIBSUBDIR to lib64 on 64bit architectures.
Upstream: merged (expected v0.5.0)
Git-commit: 6eb5e25905d2258c595d7fc75624c60a357c1c3b
commit a82a66e ("Extend build and add install rules to Makefile") adds
special handling for LIBSUBDIR on x86_64. Expand this to all
architectures with 64 in name which suggests a 32bit variant exists, and
s390x which is 64bit extension of s390.
Fixes: #337
Fixes: a82a66e ("Extend build and add install rules to Makefile")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
src/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile b/src/Makefile
index 8161fec..8bf1d8a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -60,7 +60,7 @@ INSTALL = install
DESTDIR ?=
-ifeq ($(shell uname -m),x86_64)
+ifeq ($(filter-out %64 %64be %64eb %64le %64el s390x, $(shell uname -m)),)
LIBSUBDIR := lib64
else
LIBSUBDIR := lib
--
2.32.0