From: Ben Hutchings Date: Thu, 13 Aug 2020 23:43:54 +0000 (+0100) Subject: bpftool: Fix version string in recursive builds X-Git-Tag: archive/raspbian/5.15.15-2+rpi1~1^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2ee087ada9ab5c858c2a786c447536e1a7d33b19;p=linux.git bpftool: Fix version string in recursive builds Forwarded: https://lore.kernel.org/bpf/20200813235837.GA497088@decadent.org.uk/T/#u When bpftool is built as part of a Debian package build, which itself uses make, "bpftool version" shows: bpftool vmake[4]: Entering directory /build/linux-5.8/tools/bpf/bpftool 5.8.8.0 make[4]: Leaving directory /build/linux-5.8 Although we pass the "--no-print-directory" option, this is overridden by the environment variable "MAKEFLAGS=w". Clear MAKEFLAGS for the "make kernelversion" command. I have no explanation for the doubled ".8" in the version string, but this seems to fix that as well. Signed-off-by: Ben Hutchings Gbp-Pq: Topic bugfix/all Gbp-Pq: Name bpftool-fix-version-string-in-recursive-builds.patch --- diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index d73232be1e9..99a6b7d08d3 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -31,7 +31,7 @@ LIBBPF_BOOTSTRAP_OUTPUT = $(BOOTSTRAP_OUTPUT)libbpf/ LIBBPF_BOOTSTRAP = $(LIBBPF_BOOTSTRAP_OUTPUT)libbpf.a ifeq ($(BPFTOOL_VERSION),) -BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion) +BPFTOOL_VERSION := $(shell MAKEFLAGS= make -rR --no-print-directory -sC ../../.. kernelversion) endif $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT) $(LIBBPF_BOOTSTRAP_OUTPUT):