vmware-archive / p4c-xdp

Backend for the P4 compiler targeting XDP
Apache License 2.0
171 stars 26 forks source link

Using XDP with clang/llvm version 9 #124

Open maharishib opened 4 years ago

maharishib commented 4 years ago

Hi, My XDP code is running perfectly with clang/llvm version < 8. When compiling using v9, I get the following error: 0 maps not supported in current map section! Error fixing up map structure, incompatible struct bpf_elf_map used? Error fetching ELF ancillary data!

I need to use v9 as bpf_spin_locks are not supported by clang/llvm version < 8 due to some BTF annotation issue.

mihaibudiu commented 4 years ago

I frankly do not think this is a problem with our compiler; here are other people complaining about a similar problem: https://forums.whirlpool.net.au/archive/9znlnrk9 The error message is somewhere in iproute.

maharishib commented 4 years ago

OK Thanks

mihaibudiu commented 4 years ago

On the other hand, we are using some hand-crafted bpf headers, which may become incompatible with the kernel headers if they change. This has been a long-standing problem. I understand that there may be better solutions in newer kernel versions.