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=-8.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 2EDC9C43381 for ; Wed, 20 Mar 2019 20:44:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8F24218C3 for ; Wed, 20 Mar 2019 20:44:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fomichev-me.20150623.gappssmtp.com header.i=@fomichev-me.20150623.gappssmtp.com header.b="uRHlrP12" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727458AbfCTUol (ORCPT ); Wed, 20 Mar 2019 16:44:41 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37319 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfCTUol (ORCPT ); Wed, 20 Mar 2019 16:44:41 -0400 Received: by mail-pf1-f193.google.com with SMTP id 8so2771239pfr.4 for ; Wed, 20 Mar 2019 13:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gM7pnMYPwFD+6gQL3vT5AAhwz9PnNYM4dwKh9DiiEhE=; b=uRHlrP12iVlOrqMq4YrnbGj+KVCau0dbu3LUKoO4L/h2VUKtiDay2v7JmclMvfv2Z5 Y/CTnIpIKgwD1acwd9dKKAeaYBk8+E/ZEgFpNJJnQKCXla0nA3Q0kAuo2zX0vOWgP7eH SMcGmZkafqMscniTBPodOSEFAJdkq/hdFtSQhVillMDVAxPzOGKGQ3etT2RPo3UvlQ6u WWSeIXHk/9xQYrh8pCDQ0+lC2yDUNI8pcH3yebrpmUUhuMzGXo9GZRzLr6wk71h3E2BN 3ysN/imwwVvz2m9hKtHdiwg6jF+PlzBKz5z7cYJUzJZAKzyJpCv9P3+yQKV4I+xZSAYY 0rjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gM7pnMYPwFD+6gQL3vT5AAhwz9PnNYM4dwKh9DiiEhE=; b=TuzTFUfNJe61TmnYZ4c4MrDKJ4LOd/05RuVqwYvycFGsvRRA1dyOc1D9gCdzIMJIVH vBahpzLEfW1+eHJjnhCF3pGld19Z1T6042/TWILHmg3nO299spScrvSUWLUhFnxmvtNs XkQx58SWkbfPOWbUldCArGRWGgBcmA2+gn1+y3nCSXacXR/ZWJdzqRJ3dC71jNZFs4Ms DwvMTvmm+D+PQL+y1+tqKKZ4Nph7CtUFJ7WWtko/5n9uuc3BEru8g2KuqcOQJlGOnonJ 4z+qPUFPk6D1QjqolZzv2JpTVQ3KgYw+0Epi4ade2DTAbjIjP7hMkDd4q5kC8ZV1g9sa JcNA== X-Gm-Message-State: APjAAAUEILJaGzR9ZHcTlwXFngXo1UcZCeCfkow+ZENEIQ0Js/KkDTri /0qYCyAijut89KMeb7wNOi/jfQ== X-Google-Smtp-Source: APXvYqyRDz8zprZXHIf7G+Q2ZpZujQbxZ79Ds6fIwRnA3wK7DblJPNYroeiq0uYLXp4GoH7uSWZElQ== X-Received: by 2002:a63:cf0f:: with SMTP id j15mr37778pgg.329.1553114680263; Wed, 20 Mar 2019 13:44:40 -0700 (PDT) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id f192sm6752450pfc.180.2019.03.20.13.44.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 13:44:39 -0700 (PDT) Date: Wed, 20 Mar 2019 13:44:38 -0700 From: Stanislav Fomichev To: Luca Boccassi Cc: netdev@vger.kernel.org Subject: Re: [PATCH bpf-next v2] tools/bpf: generate pkg-config file for libbpf Message-ID: <20190320204438.GO7431@mini-arch.hsd1.ca.comcast.net> References: <20190319210639.6282-1-bluca@debian.org> <20190319230042.32087-1-bluca@debian.org> <20190319231713.GG7431@mini-arch.hsd1.ca.comcast.net> <20190320172114.GK7431@mini-arch.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 03/20, Luca Boccassi wrote: > On Wed, 2019-03-20 at 10:21 -0700, Stanislav Fomichev wrote: > > On 03/20, Luca Boccassi wrote: > > > On Wed, 2019-03-20 at 13:22 +0000, Luca Boccassi wrote: > > > > On Tue, 2019-03-19 at 16:17 -0700, Stanislav Fomichev wrote: > > > > > On 03/19, Luca Boccassi wrote: > > > > > > Generate a libbpf.pc file at build time so that users can > > > > > > rely > > > > > > on pkg-config to find the library, its CFLAGS and LDFLAGS. > > > > > > > > > > > > Signed-off-by: Luca Boccassi > > > > > > --- > > > > > > v2: use QUIET_GEN instead of QUIET_LINK to generate pc file, > > > > > > save kernel version in its own variable instead of > > > > > > calling > > > > > > make inline > > > > > > > > > > > > tools/lib/bpf/.gitignore | 1 + > > > > > > tools/lib/bpf/Makefile | 19 ++++++++++++++++--- > > > > > > tools/lib/bpf/libbpf.pc.template | 11 +++++++++++ > > > > > > 3 files changed, 28 insertions(+), 3 deletions(-) > > > > > > create mode 100644 tools/lib/bpf/libbpf.pc.template > > > > > > > > > > > > diff --git a/tools/lib/bpf/.gitignore > > > > > > b/tools/lib/bpf/.gitignore > > > > > > index 4db74758c674..7d9e182a1f51 100644 > > > > > > --- a/tools/lib/bpf/.gitignore > > > > > > +++ b/tools/lib/bpf/.gitignore > > > > > > @@ -1,3 +1,4 @@ > > > > > > libbpf_version.h > > > > > > +libbpf.pc > > > > > > FEATURE-DUMP.libbpf > > > > > > test_libbpf > > > > > > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile > > > > > > index a05c43468bd0..1df3ebfb3118 100644 > > > > > > --- a/tools/lib/bpf/Makefile > > > > > > +++ b/tools/lib/bpf/Makefile > > > > > > @@ -80,6 +80,7 @@ libdir_SQ = $(subst ','\'',$(libdir)) > > > > > > libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) > > > > > > > > > > > > LIB_FILE = libbpf.a libbpf.so > > > > > > +PC_FILE = libbpf.pc > > > > > > > > > > > > VERSION = $(BPF_VERSION) > > > > > > PATCHLEVEL = $(BPF_PATCHLEVEL) > > > > > > @@ -89,6 +90,7 @@ OBJ = $@ > > > > > > N = > > > > > > > > > > > > LIBBPF_VERSION = > > > > > > $(BPF_VERSION).$(BPF_PATCHLEVEL).$(BPF_EXTRAVERSION) > > > > > > +KERNEL_VERSION = $(shell make --no-print-directory -sC > > > > > > ../../.. > > > > > > kernelversion) > > > > > Oh, we do already have LIBBPF_VERSION, why not use that? This > > > > > way > > > > > you don't need to do anything for out-of-tree libbpf from > > > > > github. > > > > > > > > > > I don't remember what was the strategy regarding libbpf > > > > > versioning, > > > > > but > > > > > that 0.0.1 should be changed to something sensible (be set to > > > > > the > > > > > kernel > > > > > version upon release?) > > > > > > > > [re-sending as reply via phone added html and the list daemon > > > > said > > > > no- > > > > no] > > > > > > > > That looks like the ABI version though, rather than the source > > > > version? > > > > The source version is more appropriate for the PC file > > > > > > That said, the versioning looks looks like it could use some love > > > and > > > it's not really a factor that should gate a pkg-config file and > > > could > > > be done separately if required, so in v3 I've removed > > > KERNEL_VERSION > > > and used LIBBPF_VERSION as you suggested. > > Agree :-) There was some conversation recently about incrementing it > > per > > kernel release vs real api change. I don't remember what the outcome > > was exactly. > > I see, thanks. Anything else you'd like me to change? No, everything looks good to me, wait for the reply from the bpf maintainers. > -- > Kind regards, > Luca Boccassi