Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libbpf for openSUSE:Factory checked in at 2021-09-25 00:35:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libbpf (Old) and /work/SRC/openSUSE:Factory/.libbpf.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libbpf" Sat Sep 25 00:35:08 2021 rev:6 rq:920620 version:0.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libbpf/libbpf.changes 2021-08-24 10:55:05.608303415 +0200 +++ /work/SRC/openSUSE:Factory/.libbpf.new.1899/libbpf.changes 2021-09-25 00:35:40.223146666 +0200 @@ -1,0 +2,6 @@ +Fri Aug 27 06:20:53 UTC 2021 - Michal Suchanek <msucha...@suse.com> + +- Fix LTO build (bsc#1188749). + + libbpf-Fix-build-with-latest-gcc-binutils-with-LTO.patch + +------------------------------------------------------------------- New: ---- libbpf-Fix-build-with-latest-gcc-binutils-with-LTO.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libbpf.spec ++++++ --- /var/tmp/diff_new_pack.ME998U/_old 2021-09-25 00:35:40.631147092 +0200 +++ /var/tmp/diff_new_pack.ME998U/_new 2021-09-25 00:35:40.635147096 +0200 @@ -28,6 +28,8 @@ 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 @@ -51,14 +53,15 @@ %prep %setup -q +%autopatch -p1 %build cd src -%make_build V=1 CFLAGS="%{optflags} -fno-lto" +%make_build V=1 CFLAGS="%{optflags}" %install cd src -%make_install V=1 LIBDIR=%{_libdir} +%make_install V=1 rm -f %{buildroot}%{_libdir}/%{name}.a %post -n %{libname} -p /sbin/ldconfig ++++++ libbpf-Fix-build-with-latest-gcc-binutils-with-LTO.patch ++++++ >From acc7f8895899a7a1281d27983ce807e3f7b831ce Mon Sep 17 00:00:00 2001 From: Patrick McCarty <patrick.mcca...@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.mcca...@intel.com> Make the change conditional on GCC version Signed-off-by: Michal Suchanek <msucha...@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