Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can make minimal,but can't make bpftool,why? #286

Open
Ruid6 opened this issue Sep 10, 2024 · 2 comments
Open

I can make minimal,but can't make bpftool,why? #286

Ruid6 opened this issue Sep 10, 2024 · 2 comments

Comments

@Ruid6
Copy link

Ruid6 commented Sep 10, 2024

Ubuntu 22.04 LTS:6.8.0-40-generic

I've read the Readme

apt install clang libelf1 libelf-dev zlib1g-dev
git clone --recurse-submodules https://github.com/libbpf/libbpf-bootstrap
git submodule update --init --recursive
cd examples/c
make

OUTPUT:

MKDIR .output
MKDIR .output/libbpf
LIB libbpf.a
make[1]: pkg-config: 没有那个文件或目录
MKDIR /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/bpf.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/btf.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/libbpf.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/libbpf_errno.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/netlink.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/nlattr.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/str_error.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/libbpf_probes.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/bpf_prog_linfo.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/btf_dump.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/hashmap.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/ringbuf.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/strset.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/linker.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/gen_loader.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/relo_core.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/usdt.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/zip.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/elf.o
CC /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/staticobjs/features.o
AR /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/libbpf.a
INSTALL bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h bpf_helpers.h bpf_helper_defs.h bpf_tracing.h bpf_endian.h bpf_core_read.h skel_internal.h libbpf_version.h usdt.bpf.h
INSTALL /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/libbpf.pc
INSTALL /home/ruid/libbpf-bootstrap/examples/c/.output//libbpf/libbpf.a
MKDIR bpftool
BPFTOOL bpftool/bootstrap/bpftool
... libbfd: [ OFF ]
... clang-bpf-co-re: [ on ]
... llvm: [ OFF ]
... libcap: [ OFF ]
MKDIR /home/ruid/libbpf-bootstrap/examples/c/.output/bpftool/bootstrap/libbpf/include/bpf
INSTALL /home/ruid/libbpf-bootstrap/examples/c/.output/bpftool/bootstrap/libbpf/include/bpf/hashmap.h
INSTALL /home/ruid/libbpf-bootstrap/examples/c/.output/bpftool/bootstrap/libbpf/include/bpf/relo_core.h
INSTALL /home/ruid/libbpf-bootstrap/examples/c/.output/bpftool/bootstrap/libbpf/include/bpf/libbpf_internal.h
MKDIR /home/ruid/libbpf-bootstrap/examples/c/.output/bpftool/bootstrap/
MKDIR /home/ruid/libbpf-bootstrap/examples/c/.output/bpftool/bootstrap/libbpf/
make[2]: pkg-config: 没有那个文件或目录
......

But, sudo ./bootstrap work successfully.
Than , cd bpftool/src && make

... libbfd: [ OFF ]
... clang-bpf-co-re: [ on ]
... llvm: [ OFF ]
... libcap: [ OFF ]
GEN pid_iter.skel.h
CC pids.o
CLANG profiler.bpf.o
make: llvm-strip: 没有那个文件或目录
make: *** [Makefile:209:profiler.bpf.o] 错误 127

What's wrong with me?

@anakryiko
Copy link
Member

Nothing is wrong with you :) full-blown bpftool expects llvm-strip (for no good reason, anymore), so make sure you have that tool available.

cc @qmonnet, it would be nice to remove llvm-strip, bpftool gen object strips out DWARF already, so you shouldn't need extra stripping.

@qmonnet
Copy link
Member

qmonnet commented Sep 10, 2024

Hey! I can't even remember why we have it. Looking at the logs, you added it in torvalds/linux@f3c93a9, but if now we strip it already then I guess the command brings nothing and yes, I'll remove it (give me a few days)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants