From bcdb9be188649c5186bae39ed51aa59fa66cd4f43d45e124c6ac0dad6c2d85d7 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 16 Feb 2023 14:45:03 +0000 Subject: [PATCH] Accepting request 1065908 from home:marxin:branches:Base:System - Add binutils-2.40.patch where we need to explicitly link against -lsframe. It's a workaround for an existing issue: https://github.com/libbpf/bpftool/issues/73. OBS-URL: https://build.opensuse.org/request/show/1065908 OBS-URL: https://build.opensuse.org/package/show/Base:System/bpftool?expand=0&rev=10 --- binutils-2.40.patch | 13 +++++++++++++ bpftool.changes | 7 +++++++ bpftool.spec | 9 +++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 binutils-2.40.patch diff --git a/binutils-2.40.patch b/binutils-2.40.patch new file mode 100644 index 0000000..9cfdf5c --- /dev/null +++ b/binutils-2.40.patch @@ -0,0 +1,13 @@ +diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile +index 4a95c017ad4c..9a4851df3276 100644 +--- a/tools/bpf/bpftool/Makefile ++++ b/tools/bpf/bpftool/Makefile +@@ -139,6 +139,8 @@ SRCS = $(filter-out $(BFD_SRCS),$(wildcard *.c)) + + ifeq ($(feature-libbfd),1) + LIBS += -lbfd -ldl -lopcodes ++else ifeq ($(feature-libbfd-liberty-sframe),1) ++ LIBS += -lbfd -ldl -lopcodes -liberty -lsframe + else ifeq ($(feature-libbfd-liberty),1) + LIBS += -lbfd -ldl -lopcodes -liberty + else ifeq ($(feature-libbfd-liberty-z),1) diff --git a/bpftool.changes b/bpftool.changes index 7dc6199..2c5dc40 100644 --- a/bpftool.changes +++ b/bpftool.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Feb 15 09:11:12 UTC 2023 - Martin Liška + +- Add binutils-2.40.patch where we need to explicitly link against + -lsframe. It's a workaround for an existing issue: + https://github.com/libbpf/bpftool/issues/73. + ------------------------------------------------------------------- Fri Oct 7 16:22:21 UTC 2022 - Callum Farmer diff --git a/bpftool.spec b/bpftool.spec index d38d352..3dde110 100644 --- a/bpftool.spec +++ b/bpftool.spec @@ -1,7 +1,7 @@ # # spec file for package bpftool # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,6 +20,7 @@ Name: bpftool Version: %{version} Release: 0 +Patch0: binutils-2.40.patch Summary: Tool for inspection and manipulation of BPF programs and maps License: GPL-2.0-only Group: Development/Tools/Other @@ -36,8 +37,8 @@ and maps) on the system. %package bash-completion Summary: Bash completion for bpftool Group: System/Shells -Requires: bash-completion Requires: %{name} +Requires: bash-completion Supplements: (%{name} and bash-completion) %description bash-completion @@ -58,12 +59,16 @@ There is no reason to install this package. (cd %{_prefix}/src/linux ; tar -cf - COPYING CREDITS README tools include scripts Kbuild Makefile arch/*/{include,lib,Makefile} kernel/bpf lib) | tar -xf - cp %{_prefix}/src/linux/LICENSES/preferred/GPL-2.0 . sed -i -e 's/CFLAGS += -O2/CFLAGS = $(RPM_OPT_FLAGS)/' Makefile +%patch0 -p1 %build cd tools/bpf/bpftool %make_build \ feature-reallocarray=1 \ feature-libbfd-liberty=1 \ +%if %(if gcc -lsframe -shared 2>/dev/null ; then echo 1 ; else echo 0; fi; ) + feature-libbfd-liberty-sframe=1 \ +%endif feature-disassembler-four-args=1 \ all \ doc