lizrice / learning-ebpf

Learning eBPF, published by O'Reilly - out now! Here's where you'll find a VM config for the examples, and more
https://www.amazon.com/Learning-eBPF-Programming-Observability-Networking/dp/1098135121
Apache License 2.0
1.19k stars 255 forks source link

One problem with make or make install #40

Closed killerwzb closed 5 months ago

killerwzb commented 5 months ago

Hi,I make this and get error from make command,it like this: [wangzhibin@localhost src]$ make MKDIR staticobjs CC staticobjs/bpf.o CC staticobjs/btf.o CC staticobjs/libbpf.o CC staticobjs/libbpf_errno.o CC staticobjs/netlink.o CC staticobjs/nlattr.o CC staticobjs/str_error.o CC staticobjs/libbpf_probes.o CC staticobjs/bpf_prog_linfo.o CC staticobjs/btf_dump.o btf_dump.c: In function ‘btf_dump_dump_type_data.isra.24’: btf_dump.c:2363:5: error: ‘err’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (err < 0) ^ cc1: all warnings being treated as errors make: *** [staticobjs/btf_dump.o] Error 1

How can I solve it?

lizrice commented 5 months ago

It's not clear where you are running this make command but I'm going to guess from the src in the prompt that you're building libbpf? That's a separate project, pulled in here as a submodule for convenience. If you're having problems with libbpf then the project repo is here.