]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Stop using feature-detection Makefiles
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 3 Feb 2021 20:34:45 +0000 (12:34 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 4 Feb 2021 00:22:00 +0000 (01:22 +0100)
commit3e1a4f1b7579ef78d4484e2e6d7638ef45b491ff
tree156057eea4fbda61d0341f53d233e5dca3123884
parent2e7f3a3e5448194e3a2dd2f83d0be38c3ded828b
libbpf: Stop using feature-detection Makefiles

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).

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/bpf/20210203203445.3356114-1-andrii@kernel.org
tools/lib/bpf/.gitignore
tools/lib/bpf/Makefile