libbpf-tools: don't ignore LDFLAGS

Needed to pass gating.

Related: rhbz#1965385
This commit is contained in:
Jerome Marchand 2021-06-02 18:05:36 +02:00
parent 142c3b9630
commit bf9b748ed9
3 changed files with 31 additions and 28 deletions

View File

@ -0,0 +1,25 @@
From 657f1b2049f2c7751a9d2a13abb42c409da1bb6f Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
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

View File

@ -1,25 +0,0 @@
From cfa24faa693ce05e2c1bcfbadc938a047272b7f6 Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
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

View File

@ -27,14 +27,14 @@
Name: bcc Name: bcc
Version: 0.20.0 Version: 0.20.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: BPF Compiler Collection (BCC) Summary: BPF Compiler Collection (BCC)
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/iovisor/bcc URL: https://github.com/iovisor/bcc
# Upstream now provides a release with the git submodule embedded in it # 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}/releases/download/v%{version}/%{name}-src-with-submodule.tar.gz
#Source0: %{url}/archive/v%{version}/%{name}-%{version}.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 # Arches will be included as upstream support is added and dependencies are
# satisfied in the respective arches # satisfied in the respective arches
@ -148,7 +148,7 @@ Command line libbpf tools for BPF Compiler Collection (BCC)
# take them. # take them.
%if %{with libbpf_tools} %if %{with libbpf_tools}
pushd libbpf-tools; pushd libbpf-tools;
make BPFTOOL=bpftool make BPFTOOL=bpftool CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}"
make DESTDIR=./tmp-install prefix= install make DESTDIR=./tmp-install prefix= install
(cd tmp-install/bin; for file in *; do mv $file bpf-$file; done;) (cd tmp-install/bin; for file in *; do mv $file bpf-$file; done;)
popd popd
@ -227,6 +227,9 @@ install libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}
%endif %endif
%changelog %changelog
* Wed Jun 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.20.0-3
- Don't ignore LDFLAGS for libbpf-tools
* Wed Jun 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.20.0-2 * Wed Jun 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.20.0-2
- Don't override cflags for libbpf-tools - Don't override cflags for libbpf-tools