Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 186FFC38142 for ; Mon, 23 Jan 2023 21:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233023AbjAWVLj (ORCPT ); Mon, 23 Jan 2023 16:11:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232967AbjAWVLh (ORCPT ); Mon, 23 Jan 2023 16:11:37 -0500 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12F083C22; Mon, 23 Jan 2023 13:11:35 -0800 (PST) Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pK3Z6-000H7X-2M; Mon, 23 Jan 2023 21:37:16 +0100 Received: from [85.1.206.226] (helo=linux.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pK3Z5-000Tjt-Gf; Mon, 23 Jan 2023 21:37:15 +0100 Subject: Re: [PATCH v3 1/2] tools/resolve_btfids: Install subcmd headers To: Ian Rogers , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Connor OBrien , Nathan Chancellor , Kumar Kartikeya Dwivedi , bpf@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230119183118.126387-1-irogers@google.com> <20230119183118.126387-2-irogers@google.com> From: Daniel Borkmann Message-ID: Date: Mon, 23 Jan 2023 21:37:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20230119183118.126387-2-irogers@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.7/26790/Mon Jan 23 09:31:32 2023) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/19/23 7:31 PM, Ian Rogers wrote: > Previously tools/lib/subcmd was added to the include path, switch to > installing the headers and then including from that directory. This > avoids dependencies on headers internal to tools/lib/subcmd. Add the > missing subcmd directory to the affected #include. > > Signed-off-by: Ian Rogers > --- > tools/bpf/resolve_btfids/Makefile | 19 ++++++++++++++----- > tools/bpf/resolve_btfids/main.c | 2 +- > 2 files changed, 15 insertions(+), 6 deletions(-) > > diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile > index 19a3112e271a..76b737b2560d 100644 > --- a/tools/bpf/resolve_btfids/Makefile > +++ b/tools/bpf/resolve_btfids/Makefile > @@ -35,21 +35,29 @@ SUBCMD_SRC := $(srctree)/tools/lib/subcmd/ > BPFOBJ := $(OUTPUT)/libbpf/libbpf.a > LIBBPF_OUT := $(abspath $(dir $(BPFOBJ)))/ > SUBCMDOBJ := $(OUTPUT)/libsubcmd/libsubcmd.a > +SUBCMD_OUT := $(abspath $(dir $(SUBCMDOBJ)))/ > > LIBBPF_DESTDIR := $(LIBBPF_OUT) > LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)include > > +SUBCMD_DESTDIR := $(SUBCMD_OUT) > +SUBCMD_INCLUDE := $(SUBCMD_DESTDIR)include > + > BINARY := $(OUTPUT)/resolve_btfids > BINARY_IN := $(BINARY)-in.o > > all: $(BINARY) > > +prepare: $(BPFOBJ) $(SUBCMDOBJ) > + > $(OUTPUT) $(OUTPUT)/libsubcmd $(LIBBPF_OUT): > $(call msg,MKDIR,,$@) > $(Q)mkdir -p $(@) > > $(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd > - $(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@) > + $(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(SUBCMD_OUT) \ > + DESTDIR=$(SUBCMD_DESTDIR) prefix= \ > + $(abspath $@) install_headers > > $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUT) > $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(LIBBPF_OUT) \ > @@ -60,14 +68,14 @@ CFLAGS += -g \ > -I$(srctree)/tools/include \ > -I$(srctree)/tools/include/uapi \ > -I$(LIBBPF_INCLUDE) \ > - -I$(SUBCMD_SRC) > + -I$(SUBCMD_INCLUDE) > > LIBS = -lelf -lz > This series needs a rebase against bpf-next, given it results in merge conflict e.g. see commit 0e43662e61f2 ("tools/resolve_btfids: Use pkg-config to locate libelf") from Dec 15th. Thanks, Daniel