From patchwork Thu Aug 13 23:58:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 1344534 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=debian.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BSNnZ3LTtz9sTN for ; Fri, 14 Aug 2020 09:58:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726531AbgHMX6l (ORCPT ); Thu, 13 Aug 2020 19:58:41 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:36198 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgHMX6l (ORCPT ); Thu, 13 Aug 2020 19:58:41 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1k6N7F-0002CB-RW; Fri, 14 Aug 2020 00:58:37 +0100 Received: from ben by deadeye with local (Exim 4.94) (envelope-from ) id 1k6N7F-0025KS-8B; Fri, 14 Aug 2020 00:58:37 +0100 Date: Fri, 14 Aug 2020 00:58:37 +0100 From: Ben Hutchings To: Alexei Starovoitov , Daniel Borkmann Cc: bpf@vger.kernel.org, debian-kernel@lists.debian.org Subject: [PATCH] bpftool: Fix version string in recursive builds Message-ID: <20200813235837.GA497088@decadent.org.uk> MIME-Version: 1.0 Content-Disposition: inline X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org 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 --- tools/bpf/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 9e85f101be85..7fbad8cbd171 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -25,7 +25,7 @@ endif LIBBPF = $(LIBBPF_PATH)libbpf.a -BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion) +BPFTOOL_VERSION := $(shell MAKEFLAGS= make -rR --no-print-directory -sC ../../.. kernelversion) $(LIBBPF): FORCE $(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))