From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 047D5C433FF for ; Tue, 13 Aug 2019 00:38:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0CAF206A2 for ; Tue, 13 Aug 2019 00:38:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lekensteyn.nl header.i=@lekensteyn.nl header.b="ciGHFGjs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfHMAin (ORCPT ); Mon, 12 Aug 2019 20:38:43 -0400 Received: from lekensteyn.nl ([178.21.112.251]:44991 "EHLO lekensteyn.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbfHMAim (ORCPT ); Mon, 12 Aug 2019 20:38:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From; bh=ONKDn6aMI9lJO/Tg9ivj+IvjyVhldVXDlzxa/+6/nwA=; b=ciGHFGjsC7qnZMLdiBjHYqSU9xq28rmQDxN3nrBjPNHhVPEJQApdWpGuUZDplUu+oxAlKbBzqbXpmxQIxXrWl71Ayo4R9ofChfBsRHVPnPqh2LyipMQ7ImSDxPnEuc7Bov/yDC4mxcQyet4xL8uleYhezQoDHkanBpV9unjs4ZYHEQoZot2pi/8L+pUWLwsynhljz6m4o7cE/ODKDgPm9yG01FuisI4ixVV0bsLOG5tpmmUGlUBlQZ01AOHfQjEH/FrEUfvhJAMs3PfaDe+V+HSRbcBKN4ngh151uS4SN905j44K/GZm7vC1+wVZmWpB/OqGux0g7HeKHV1SOHfEgw==; Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1hxKpe-0004yD-VU; Tue, 13 Aug 2019 02:38:35 +0200 From: Peter Wu To: Daniel Borkmann , Jakub Kicinski Cc: Stanislav Fomichev , Alexei Starovoitov , netdev@vger.kernel.org, Quentin Monnet Subject: [PATCH] tools: bpftool: add feature check for zlib Date: Tue, 13 Aug 2019 01:38:32 +0100 Message-Id: <20190813003833.22042-1-peter@lekensteyn.nl> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org bpftool requires libelf, and zlib for decompressing /proc/config.gz. zlib is a transitive dependency via libelf, and became mandatory since elfutils 0.165 (Jan 2016). The feature check of libelf is already done in the elfdep target of tools/lib/bpf/Makefile, pulled in by bpftool via a dependency on libbpf.a. Add a similar feature check for zlib. Suggested-by: Jakub Kicinski Signed-off-by: Peter Wu --- Hi, This is a follow-up for an earlier "tools: bpftool: fix reading from /proc/config.gz" patch. It applies Jakub and Daniel suggestions from: https://lkml.kernel.org/r/6154af6c-4f24-4b0a-25c2-a8a1d6c9948f@iogearbox.net https://lkml.kernel.org/r/20190809140956.24369b00@cakuba.netronome.com Feel free to massage the commit message and patch as you see fit. Kind regards, Peter --- tools/bpf/bpftool/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 078bd0dcfba5..4c9d1ffc3fc7 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -58,8 +58,8 @@ INSTALL ?= install RM ?= rm -f FEATURE_USER = .bpftool -FEATURE_TESTS = libbfd disassembler-four-args reallocarray -FEATURE_DISPLAY = libbfd disassembler-four-args +FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib +FEATURE_DISPLAY = libbfd disassembler-four-args zlib check_feat := 1 NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall @@ -111,6 +111,8 @@ OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o $(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c $(QUIET_CC)$(COMPILE.c) -MMD -o $@ $< +$(OUTPUT)feature.o: | zdep + $(OUTPUT)bpftool: $(OBJS) $(LIBBPF) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) @@ -149,6 +151,9 @@ doc-uninstall: FORCE: -.PHONY: all FORCE clean install uninstall +zdep: + @if [ "$(feature-zlib)" != "1" ]; then echo "No zlib found"; exit 1 ; fi + +.PHONY: all FORCE clean install uninstall zdep .PHONY: doc doc-clean doc-install doc-uninstall .DEFAULT_GOAL := all -- 2.22.0