eBPF on OpenWrt

Hey folks,

Has anyone tried to compile ebpf/xdp code on top of openwrt. I have installed openwrt on raspberry pi and tried to compile a sample ebpf program and found it lacks some tools/packages like clang, etc.. If anyone has done this before please share some guide/articles to setup a ebpf development environment on openwrt.

I also tried to run tracee which is BTF enabled(Compile once run anywhere), but it failed with the following error

unexpected ( at line 2

If anyone has tried these out before share some resources please.

You will need to cross-compile at (firmware-)build time, see qosify as an example.

For xdp-tools, there's an open PR which also contains some background about why this isn't as easy as one might hope:

Could you please test that and leave a comment there if it works?
Specifically, these two top commits: https://github.com/dhewg/openwrt/commits/xdp

@dhewg I'm new to openWRT space,

Could you please test that

Does this mean I have compile it from those commits and flash it to Raspberry pi and check if I can compile my eBPF programs?