xdp-project / xdp-tools

Utilities and example programs for use with XDP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to Compile xdp-tools "libbpf: failed to find BTF for extern 'llvm.bpf.passthrough.p0i32.p0i32': -2"

Lakshyagour opened this issue · comments

I am on ubuntu 20.04.6
Kernel version - 5.15.0-82-generic

Configure Output :
Found clang binary 'clang' with version 12 (from 'Ubuntu clang version 12.0.0-3ubuntu1~20.04.5') using bpftool v7.4.0 libbpf support: system v1.2.0 perf_buffer__consume support: yes btf__load_from_kernel_by_id support: yes btf__type_cnt support: yes bpf_object__next_map support: yes bpf_object__next_program support: yes bpf_program__insn_cnt support: yes bpf_program__type support: yes bpf_program__flags support: yes bpf_program__expected_attach_type support: yes bpf_map_create support: yes perf_buffer__new_raw support: yes bpf_xdp_attach support: yes bpf_map__set_autocreate support: yes bpf_prog_test_run_opts support: yes bpf_xdp_query support: yes secure_getenv support: yes

Make output :
`
lib

libxdp
CC staticobjs/libxdp.o
CC staticobjs/xsk.o
CLANG xdp-dispatcher.o
LLC xdp-dispatcher.o
GEN xdp-dispatcher.embed.o
CLANG xsk_def_xdp_prog.o
LLC xsk_def_xdp_prog.o
GEN xsk_def_xdp_prog.embed.o
CLANG xsk_def_xdp_prog_5.3.o
LLC xsk_def_xdp_prog_5.3.o
GEN xsk_def_xdp_prog_5.3.embed.o
LINK libxdp.a
CC sharedobjs/libxdp.o
CC sharedobjs/xsk.o
LINK libxdp.so.1.4.0

util
CLANG xdp_sample.bpf.o
LLC xdp_sample.bpf.o
GEN xdp_sample.skel.h
libbpf: failed to find BTF for extern 'llvm.bpf.passthrough.p0i32.p0i32': -2
Error: failed to open BPF object file: No such file or directory
make[2]: *** [Makefile:34: xdp_sample.skel.h] Error 254
make[1]: *** [Makefile:13: util] Error 2
make: *** [Makefile:25: lib] Error 2`

Please help I am unable to find anything that can help me solve the issue.
Thank you,

There was some issue with already installed libraries. I reinstalled ubuntu on the machine and the problem was resolved.

Great, thank you for the update!