bpftool: Group libbfd defs in Makefile, only pass them if we use libbfd
authorQuentin Monnet <quentin@isovalent.com>
Tue, 25 Oct 2022 15:03:25 +0000 (16:03 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Oct 2022 17:11:56 +0000 (10:11 -0700)
commit2ea4d86a5093defcb2fc49799184ede178e64d36
tree46984f70aa0c0a1b584faea7a43087ac66bd8741
parent108326d6fa6c04e1473886fd662981792fc708a2
bpftool: Group libbfd defs in Makefile, only pass them if we use libbfd

Bpftool uses libbfd for disassembling JIT-ed programs. But the feature
is optional, and the tool can be compiled without libbfd support. The
Makefile sets the relevant variables accordingly. It also sets variables
related to libbfd's interface, given that it has changed over time.

Group all those libbfd-related definitions so that it's easier to
understand what we are testing for, and only use variables related to
libbfd's interface if we need libbfd in the first place.

In addition to make the Makefile clearer, grouping the definitions
related to disassembling JIT-ed programs will help support alternatives
to libbfd.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Tested-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20221025150329.97371-5-quentin@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/Makefile