bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
	daniel@iogearbox.net
Cc: andrii@kernel.org, kernel-team@fb.com,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: RE: [PATCH bpf-next] libbpf: stop using feature-detection Makefiles
Date: Wed, 03 Feb 2021 13:31:42 -0800	[thread overview]
Message-ID: <601b163e1bc2b_4e26f20898@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20210203203445.3356114-1-andrii@kernel.org>

Andrii Nakryiko wrote:
> Libbpf's Makefile relies on Linux tools infrastructure's feature detection
> framework, but libbpf's needs are very modest: it detects the presence of
> libelf and libz, both of which are mandatory. So it doesn't benefit much from
> the framework, but pays significant costs in terms of maintainability and
> debugging experience, when something goes wrong. The other feature detector,
> testing for the presernce of minimal BPF API in system headers is long
> obsolete as well, providing no value.
> 
> So stop using feature detection and just assume the presence of libelf and
> libz during build time. Worst case, user will get a clear and actionable
> linker error, e.g.:
> 
>   /usr/bin/ld: cannot find -lelf
> 
> On the other hand, we completely bypass recurring issues various users
> reported over time with false negatives of feature detection (libelf or libz
> not being detected, while they are actually present in the system).
> 
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
> ---
>  tools/lib/bpf/.gitignore |  1 -
>  tools/lib/bpf/Makefile   | 47 ++++------------------------------------
>  2 files changed, 4 insertions(+), 44 deletions(-)

I've also hit these annoying cases at least once or twice.

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2021-02-03 21:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 20:34 [PATCH bpf-next] libbpf: stop using feature-detection Makefiles Andrii Nakryiko
2021-02-03 21:31 ` John Fastabend [this message]
2021-02-03 23:29 ` Randy Dunlap
2021-02-04  0:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=601b163e1bc2b_4e26f20898@john-XPS-13-9370.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=acme@redhat.com \
    --cc=andrii@kernel.org \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).