Git Product home page Git Product logo

Comments (7)

chenhengqi avatar chenhengqi commented on June 3, 2024 2

You need libelf.

https://github.com/libbpf/libbpf-bootstrap#install-dependencies

from libbpf-bootstrap.

waruqi avatar waruqi commented on June 3, 2024 1

@neomafo88 this patch has been merged, you can try it again. #85

xrepo update-repo
xmake f -p android -c
xmake

from libbpf-bootstrap.

anakryiko avatar anakryiko commented on June 3, 2024

@chenhengqi maybe it's good to mention that it has to be -dev version of libelf package? libelf itself is necessary at runtime, but for compilation you need headers which normally come with -dev/-devel (naming convention changes by Linux distro)

from libbpf-bootstrap.

neomafo88 avatar neomafo88 commented on June 3, 2024

still seems broken for me, do I have to modify the (x)makefile or something to specify some special compilation flag, or path to find includes/libs as an environment variable?

screenshot

from libbpf-bootstrap.

waruqi avatar waruqi commented on June 3, 2024

The new version of libbpf uses GElf_Nhdr, but the libelf library in xmake-repo is version 0.8.13, which does not provide the GElf_Nhdr type.

/home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -c --sysroot=/home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/toolchains/llvm/prebuilt/linux-x86_64/sysroot -isystem /home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -Qunused-arguments -target armv7-none-linux-androideabi23 -gcc-toolchain /home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -mthumb -fvisibility=hidden -Oz -I../../vmlinux -I../../libbpf/include -I../../libbpf/include/uapi -Ibuild/.gens/libbpf/android/armeabi-v7a/release/rules/bpf -D__user= -D__force= -D__poll_t=uint32_t -D__LIBELF64=1 -D__LIBELF64_LINUX=1 -D__libelf_u64_t=uint64_t -D__libelf_i64_t=int64_t -isystem /home/ruki/.xmake/packages/l/libelf/0.8.13/9f7f4d1f0b71486eaed3426ace560493/include -isystem /home/ruki/.xmake/packages/l/libelf/0.8.13/9f7f4d1f0b71486eaed3426ace560493/include/libelf -isystem /home/ruki/.xmake/packages/z/zlib/v1.2.12/12465a56333a469ead5a7bb89f6b7f1d/include -isystem /home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/sources/cxx-stl/llvm-libc++/include -isystem /home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/include -isystem /home/ruki/.xmake/packages/n/ndk/22.0/fa2bffddf5a34ccda7bf5ad397348d90/sources/cxx-stl/llvm-libc++abi/include -DNDEBUG -o build/.objs/libbpf/android/armeabi-v7a/release///libbpf/src/usdt.c.o ../../libbpf/src/usdt.c

error: ../../libbpf/src/usdt.c:562:7: error: unknown type name 'GElf_Nhdr'
GElf_Nhdr *nhdr, const char *data, size_t name_off, size_t desc_off,
^
../../libbpf/src/usdt.c:578:11: error: expected ';' after expression
GElf_Nhdr nhdr;
^
;
../../libbpf/src/usdt.c:578:2: error: use of undeclared identifier 'GElf_Nhdr'
GElf_Nhdr nhdr;

In fact, the libelf header file is already referenced, but it is too old.

-isystem /home/ruki/.xmake/packages/l/libelf/0.8.13/9f7f4d1f0b71486eaed3426ace560493/include

I'm not sure if there is a new libelf version, but elfutils should provide GElf_Nhdr, but the elfutils package in the xmake-repo repository currently only supports linux, not android.

from libbpf-bootstrap.

ThinkerYzu1 avatar ThinkerYzu1 commented on June 3, 2024

Have you tried to specify a version and "verify = false"?

from libbpf-bootstrap.

waruqi avatar waruqi commented on June 3, 2024

I use elfutils instead of old libelf to fix this issue. @see #85

It works for me.

from libbpf-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.