Comments (6)
from xdp-tools.
bofengxiaoshuai @.***> writes:
hello,I want to know how to compile xdp-loader in mips arch? I mean I want to run xdp-loader program in cpu with mips arch,thanks a lot
Well, theoretically, the same way you would compile any other program for that arch. I have no idea if there's anything that will break for such a compile, but if there is, patches are very welcome. However, I'm not sure how useful xdp-loader actually is on MIPS; the kernel support for BPF on that arch is quite limited. Haven't played with it myself, though, so YMMV.
Thank you very much for your answers.
I try to fix it,it's all steps I do,hope you can give me some advise, thanks!
1、I see lines 60-71 of the configure script file:
: ${PKG_CONFIG:=pkg-config}
: ${CC=gcc}
: ${LD=ld}
: ${OBJCOPY=objcopy}
: ${CLANG=clang}
: ${LLC=llc}
: ${M4=m4}
: ${EMACS=emacs}
: ${BPFTOOL=bpftool}
: ${READELF=readelf}
: ${ARCH_INCLUDES=}
: ${ARCH_NAME=}
2、then I modify it to:
: ${PKG_CONFIG:=pkg-config}
: ${CC=mips64el-linux-gcc}
: ${LD=mips64el-linux-ld}
: ${OBJCOPY=mips64el-linux-objcopy}
: ${CLANG=clang}
: ${LLC=llc}
: ${M4=m4}
: ${EMACS=emacs}
: ${BPFTOOL=bpftool}
3、then ./configure,below is output:
root@ubuntu:~/xdp-tools# ./configure
Found clang binary 'clang' with version 19 (from 'Ubuntu clang version 19.0.0 (++20240222053038+26d71d9ed56c-1~exp1~20240222173217.940)')
/usr/sbin/bpftool
using /usr/lib/linux-tools/5.15.0-67-generic/bpftool v5.15.85
libbpf support: submodule v1.2.0
perf_buffer__consume support: yes (submodule)
btf__load_from_kernel_by_id support: yes (submodule)
btf__type_cnt support: yes (submodule)
bpf_object__next_map support: yes (submodule)
bpf_object__next_program support: yes (submodule)
bpf_program__insn_cnt support: yes (submodule)
bpf_program__type support: yes (submodule)
bpf_program__flags support: yes (submodule)
bpf_program__expected_attach_type support: yes (submodule)
bpf_map_create support: yes (submodule)
perf_buffer__new_raw support: yes (submodule)
bpf_xdp_attach support: yes (submodule)
bpf_map__set_autocreate support: yes (submodule)
bpf_prog_test_run_opts support: yes (submodule)
bpf_xdp_query support: yes (submodule)
zlib support: yes
ELF support: yes
pcap support: yes
secure_getenv support: yes
cap-ng support: no
root@ubuntu:~/xdp-tools#
4、then I make
root@ubuntu:~/xdp-tools/xdp-loader# make
CC xdp-loader
In file included from ../lib/libbpf/src/root/usr/include/bpf/bpf.h:26:0,
from xdp-loader.c:11:
../lib/../headers/linux/bpf.h:12:30: fatal error: linux/bpf_common.h: No such file or directory
#include <linux/bpf_common.h>
^
compilation terminated.
make: *** [../lib/common.mk:107:xdp-loader] 错误 1
root@ubuntu:~/xdp-tools/xdp-loader#
from xdp-tools.
from xdp-tools.
You don't need to edit the file, you can just set these when running configure: CC=mips64el-linux-gcc LD=mips64el-linux-ld OBJCOPY=mips64el-linux-objcopy READELF=mips64el-linux-readelf ARCH_NAME=mips ./configure (or export all of them before running configure).
thank you so much for your answer,thanks you for telling me the way to assign the MACRO.
Now I have a question:
: ${PKG_CONFIG:=pkg-config}
: ${CC=mips64el-linux-gcc}
: ${LD=mips64el-linux-ld}
: ${OBJCOPY=mips64el-linux-objcopy}
: ${CLANG=clang}
: ${LLC=llc}
: ${M4=m4}
: ${EMACS=emacs}
: ${BPFTOOL=bpftool}
: ${READELF=mips64el-linux-readelf}
: ${ARCH_INCLUDES=}
: ${ARCH_NAME=mips}`
I want to know which parameter need to assign,
now I have already assigned 4,I don’t know whether it‘s enough.
and if I want to build for mips arch,
what value should assigned for INCLUDES and ARCH_NAME ?
from xdp-tools.
from xdp-tools.
bofengxiaoshuai @.***> writes:
You don't need to edit the file, you can just set these when running configure: CC=mips64el-linux-gcc LD=mips64el-linux-ld OBJCOPY=mips64el-linux-objcopy READELF=mips64el-linux-readelf ARCH_NAME=mips ./configure (or export all of them before running configure). ------------------------------------------------------------------------------------------------------------ thank you so much for your answer,thanks you for telling me the way to assign the MACRO. Now I have a question: : ${PKG_CONFIG:=pkg-config} : ${CC=mips64el-linux-gcc} : ${LD=mips64el-linux-ld} : ${OBJCOPY=mips64el-linux-objcopy} : ${CLANG=clang} : ${LLC=llc} : ${M4=m4} : ${EMACS=emacs} : ${BPFTOOL=bpftool} : ${READELF=mips64el-linux-readelf} : ${ARCH_INCLUDES=} : ${ARCH_NAME=mips}` I want to know which parameter need to assign, now I have already assigned 4,I don’t know whether it‘s enough. and if I want to build for mips arch, what value should assigned for INCLUDES and ARCH_NAME ?
No idea. I don't actually have much experience cross-compiling for MIPS, so I'm afraid you'll have to find an actual expert to answer this :)
OK,I see, Thank you so much for answer my questions!
from xdp-tools.
Related Issues (20)
- Loading of XDP program fails with `prog 'xdp_prog1': missing BPF prog type, check ELF section name 'xdp-prog1'` HOT 1
- xdp-trafficgen not transmitting packets - ndo_xdp_xmit resulting in error -6 on virtio net HOT 9
- How can I cross compile for android using ndk? HOT 1
- is a formula error in comment of xsk_prod_nb_free HOT 1
- error: llc: xdp-dispatcher.ll:410:54: error: unterminated attribute group HOT 2
- xdpdump ERROR: The kernel does not support fentry function load HOT 1
- Makefile does not install libbpf libraries into local machine. HOT 8
- s
- How to use headroom in UMEM frame? HOT 2
- Side effect of xdp_program__attach with XDP_MODE_HW? HOT 2
- test_promiscuous_selfload and test_promiscuous_preload fail in Debian testing/unstable in QEMU HOT 3
- Does the release package not include binaries? HOT 2
- xdp-loader fall back to SKB mode automatically when native mode not supported? HOT 3
- xdp-loader seems unable to pin internal .data map? HOT 4
- Why system installed libbpf is prioritized? HOT 1
- xdp-traffic generator not generating traffic to any interface HOT 3
- Stack smash when loading xdp program with ring buffer HOT 8
- xdp-trafficgen not generating traffic to another interface in skb mode HOT 4
- Couldn't open file 'xdp_drop.o': No such file or directory HOT 1
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 xdp-tools.