From bf9b748ed992bffb673124762043942af4f4a7f8 Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Wed, 2 Jun 2021 18:05:36 +0200 Subject: [PATCH] libbpf-tools: don't ignore LDFLAGS Needed to pass gating. Related: rhbz#1965385 --- ...0.0-libbpf-tool-don-t-ignore-LDFLAGS.patch | 25 +++++++++++++++++++ ....0-libbpf-tool-don-t-override-CFLAGS.patch | 25 ------------------- bcc.spec | 9 ++++--- 3 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 bcc-0.20.0-libbpf-tool-don-t-ignore-LDFLAGS.patch delete mode 100644 bcc-0.20.0-libbpf-tool-don-t-override-CFLAGS.patch diff --git a/bcc-0.20.0-libbpf-tool-don-t-ignore-LDFLAGS.patch b/bcc-0.20.0-libbpf-tool-don-t-ignore-LDFLAGS.patch new file mode 100644 index 0000000..6f73a5c --- /dev/null +++ b/bcc-0.20.0-libbpf-tool-don-t-ignore-LDFLAGS.patch @@ -0,0 +1,25 @@ +From 657f1b2049f2c7751a9d2a13abb42c409da1bb6f Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Wed, 2 Jun 2021 14:23:20 +0200 +Subject: [PATCH] libbpf-tool: don't ignore LDFLAGS + +--- + libbpf-tools/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libbpf-tools/Makefile b/libbpf-tools/Makefile +index 92dcf5a5..54288380 100644 +--- a/libbpf-tools/Makefile ++++ b/libbpf-tools/Makefile +@@ -77,7 +77,7 @@ endif + + $(APPS): %: $(OUTPUT)/%.o $(LIBBPF_OBJ) $(COMMON_OBJ) | $(OUTPUT) + $(call msg,BINARY,$@) +- $(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@ ++ $(Q)$(CC) $(CFLAGS) $^ $(LDFLAGS) -lelf -lz -o $@ + + $(patsubst %,$(OUTPUT)/%.o,$(APPS)): %.o: %.skel.h + +-- +2.31.1 + diff --git a/bcc-0.20.0-libbpf-tool-don-t-override-CFLAGS.patch b/bcc-0.20.0-libbpf-tool-don-t-override-CFLAGS.patch deleted file mode 100644 index c918f85..0000000 --- a/bcc-0.20.0-libbpf-tool-don-t-override-CFLAGS.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cfa24faa693ce05e2c1bcfbadc938a047272b7f6 Mon Sep 17 00:00:00 2001 -From: Jerome Marchand -Date: Wed, 2 Jun 2021 14:23:20 +0200 -Subject: [PATCH] libbpf-tool: don't override CFLAGS - ---- - libbpf-tools/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libbpf-tools/Makefile b/libbpf-tools/Makefile -index 92dcf5a5..0bf68e50 100644 ---- a/libbpf-tools/Makefile -+++ b/libbpf-tools/Makefile -@@ -6,7 +6,7 @@ BPFTOOL ?= bin/bpftool - LIBBPF_SRC := $(abspath ../src/cc/libbpf/src) - LIBBPF_OBJ := $(abspath $(OUTPUT)/libbpf.a) - INCLUDES := -I$(OUTPUT) -I../src/cc/libbpf/include/uapi --CFLAGS := -g -O2 -Wall -+CFLAGS ?= -g -O2 -Wall - INSTALL ?= install - prefix ?= /usr/local - ARCH := $(shell uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/') --- -2.31.1 - diff --git a/bcc.spec b/bcc.spec index cf4917b..e31dbd9 100644 --- a/bcc.spec +++ b/bcc.spec @@ -27,14 +27,14 @@ Name: bcc Version: 0.20.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc # Upstream now provides a release with the git submodule embedded in it Source0: %{url}/releases/download/v%{version}/%{name}-src-with-submodule.tar.gz #Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: %{name}-%{version}-libbpf-tool-don-t-override-CFLAGS.patch +Patch0: %{name}-%{version}-libbpf-tool-don-t-ignore-LDFLAGS.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -148,7 +148,7 @@ Command line libbpf tools for BPF Compiler Collection (BCC) # take them. %if %{with libbpf_tools} pushd libbpf-tools; -make BPFTOOL=bpftool +make BPFTOOL=bpftool CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}" make DESTDIR=./tmp-install prefix= install (cd tmp-install/bin; for file in *; do mv $file bpf-$file; done;) popd @@ -227,6 +227,9 @@ install libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir} %endif %changelog +* Wed Jun 02 2021 Jerome Marchand - 0.20.0-3 +- Don't ignore LDFLAGS for libbpf-tools + * Wed Jun 02 2021 Jerome Marchand - 0.20.0-2 - Don't override cflags for libbpf-tools