From: Randy Dunlap <rdunlap@infradead.org>
To: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
daniel@iogearbox.net
Cc: kernel-team@fb.com, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH bpf-next] libbpf: stop using feature-detection Makefiles
Date: Wed, 3 Feb 2021 15:29:06 -0800 [thread overview]
Message-ID: <2127a682-1d78-49a5-26e2-cfda5b35602d@infradead.org> (raw)
In-Reply-To: <20210203203445.3356114-1-andrii@kernel.org>
On 2/3/21 12:34 PM, 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(-)
Hi Andrii,
This does indeed fix the build problems that I was seeing,
so I can add:
Acked-by: Randy Dunlap <rdunlap@infradead.org>
but in the long term I think that features/libs/etc. that are
used should be checked for instead of being used blindly... IMO.
Thanks.
--
~Randy
next prev parent reply other threads:[~2021-02-03 23:30 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
2021-02-03 23:29 ` Randy Dunlap [this message]
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=2127a682-1d78-49a5-26e2-cfda5b35602d@infradead.org \
--to=rdunlap@infradead.org \
--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 \
/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).