aya-rs / aya

Aya is an eBPF library for the Rust programming language, built with a focus on developer experience and operability.
https://aya-rs.dev/book/
Apache License 2.0
3.24k stars 290 forks source link

ebpf obj isn't compatible with libbpf v1.0+ #913

Open q9good opened 8 months ago

q9good commented 8 months ago

Hi, I create a proj from __socket_filter__ template. After compiling it to ebpf obj, I use bpftool to load it to kernel, but failed for

'libbpf: elf: legacy map definitions in 'maps' section are not supported by libbpf v1.0+' .

Here is my machine info:

# uname -a
Linux test-ThinkPad-X1 5.4.0-146-generic #163-Ubuntu SMP Fri Mar 17 18:26:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
# bpftool -V
bpftool v7.4.0
using libbpf v1.4
features: llvm
ecbaldwin commented 4 months ago

I'm also running into this. I added the following to my program attempting to use a map to avoid compiled-in configuration.

#[map(name = "interview_config")]
static mut CONFIG_MAP: Array<Config> = Array::with_max_entries(1, 0);
pomoke commented 4 months ago

Still not work.