Skip to content

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

@Ruid6

Description

@Ruid6

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions