> From: Hao Luo [mailto:haoluo@xxxxxxxxxx] > Sent: Thursday, June 30, 2022 7:29 PM > Hi Roberto, > > On Thu, Jun 30, 2022 at 6:55 AM Roberto Sassu <roberto.sassu@xxxxxxxxxx> > wrote: > > > > Hi everyone > > > > I'm testing a modified version of bpftool with the CI. > > > > Unfortunately, it does not work due to autodetection > > of libbfd in the build environment, but not in the virtual > > machine that actually executes the tests. > > > > What the proper solution should be? > > Can you elaborate by not working? do you mean bpftool doesn't build? > or bpftool builds, but doesn't behave as you expect when it runs. On > my side, when I built bpftool, libbfd was not detected, but I can > still bpftool successfully. Hi Hao in Github Actions, the build environment has support for libbfd. When bpftool is compiled, libbfd is linked to it. However, the run-time environment is different, is an ad hoc image made by the eBPF maintainers, which does not have libbfd. When a test executes bpftool, I get the following message: 2022-06-28T16:15:14.8548432Z ./bpftool_nobootstrap: error while loading shared libraries: libbfd-2.34-system.so: cannot open shared object file: No such file or directory I solved with this: diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index e32a28fe8bc1..d44f4d34f046 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -242,7 +242,9 @@ $(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) \ OUTPUT=$(HOST_BUILD_DIR)/bpftool/ \ LIBBPF_OUTPUT=$(HOST_BUILD_DIR)/libbpf/ \ LIBBPF_DESTDIR=$(HOST_SCRATCH_DIR)/ \ - prefix= DESTDIR=$(HOST_SCRATCH_DIR)/ install-bin + prefix= DESTDIR=$(HOST_SCRATCH_DIR)/ install-bin \ + FEATURE_TESTS='disassembler-four-args zlib libcap clang-bpf-co-re' \ + FEATURE_DISPLAY='disassembler-four-args zlib libcap clang-bpf-co-re' but I'm not sure it is the right approach. Thanks Roberto