Comments (7)
You need libelf
.
https://github.com/libbpf/libbpf-bootstrap#install-dependencies
from libbpf-bootstrap.
@neomafo88 this patch has been merged, you can try it again. #85
xrepo update-repo
xmake f -p android -c
xmake
from libbpf-bootstrap.
@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.
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?
from libbpf-bootstrap.
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.
Have you tried to specify a version and "verify = false"?
from libbpf-bootstrap.
I use elfutils instead of old libelf to fix this issue. @see #85
It works for me.
from libbpf-bootstrap.
Related Issues (20)
- libbpf: Error in bpf_create_map_xattr():Invalid argument(-22). Retrying without BTF HOT 2
- Fail to set up performance monitor on a CPU/Core HOT 1
- profile can't output full user stack trace HOT 2
- Dropping Ethernet packets to user space applications HOT 1
- profile program crash HOT 3
- How can I get container id from cgroup v1 with ebpf code? HOT 1
- xmake build minimal fail stddef.h:11:2: error: expected identifier false = 0, HOT 1
- Compilation fails in CentOS 7.6 HOT 3
- Retrieving argument values from newfstatat HOT 2
- Rust: How to attach a single bpf program to multiple network interfaces? HOT 3
- Make failed HOT 2
- Make error - poisoned strlcpy HOT 1
- Android xmake fails HOT 10
- add xdp synproxy in c example? HOT 2
- run fentry examples in Loongarch cpu failed HOT 2
- error: unable to create target: 'No available targets are compatible with triple "bpf"' HOT 1
- Does libbpf-bootstrap support sk_msg/stream_parser & sk_msg/stream_parser hook ?
- example uprobe no output HOT 4
- (ARM64) Rust Example Tracecon Does Not Compile HOT 2
- [Android] Failed to find valid kernel BTF HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libbpf-bootstrap.