Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to compile xdp-tools with gcc? #464

Open
vincentmli opened this issue Jan 2, 2025 · 4 comments
Open

option to compile xdp-tools with gcc? #464

vincentmli opened this issue Jan 2, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@vincentmli
Copy link

Hi @tohojo

Happy new year! :). is it trivial to add gcc as compiler to compile xdp-tools XDP program? I am porting xdp-tools to loongarch CPU and I am unable to load the XDP program due to some loongarch CPU model not allowing unaligned memory access. the loongarch kernel maintainer suggested to check if clang has strict alignment flag to enforce alignment, according to chatgpt, clang does not have such flag, gcc has such flag -mstrict-align. so I am wondering if it is possible to add gcc as a compiler option to xdp-tools. see vincentmli/BPFire#69 for more detail.

@tohojo
Copy link
Member

tohojo commented Jan 3, 2025

Erm, AFAICT from the issue you linked, the BPF program you're trying to load is not part of xdp-tools, so what difference would it make to change how xdp-tools is compiled?

@vincentmli
Copy link
Author

I forked xdp-tools as clang/llvm/Makefile framework to build my XDP programs to save me coming up my own clang/llvm/Makefile... because xdp-tools allows that addition easily, and I use xdp-loader tool to load all my XDP programs, I thought it is trivial to add gcc, so why not :). I understand adding gcc does not add benefit to xdp-tools itself and may add more burden to maintain, except for my own use case.

@tohojo
Copy link
Member

tohojo commented Jan 4, 2025 via email

@vincentmli
Copy link
Author

I just found https://gcc.gnu.org/wiki/BPFBackEnd

"
The following projects are still to be ported:

xdp-tools - https://github.com/xdp-project/xdp-tools

sched_ext - https://github.com/sched-ext/scx
"

maybe they will get to it some day :)

@tohojo tohojo added the enhancement New feature or request label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants