-
Notifications
You must be signed in to change notification settings - Fork 294
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
Use xmake to port libbpf-bootstrap and support android bpf program #17
Comments
Let me take a look and get back to you next week. We plan to expand libbpf-bootstrap to have more examples across various platforms and languages (e.g., Rust-based examples), so this might be a good addition. But I need to see what and how all things are put together to make a decision. |
My opinion (feel free to ignore me): xmake looks promising and easy to use. I'll probably try it out later for a personal project. But I'm not so sure about introducing non-standard tools to a "teaching" project. The purpose of this repo is to teach people about BPF -- any new tool / technology that isn't directly related to the goal of teaching about BPF is a distraction. |
@waruqi so after discussing with @danobi some more, I think this might be a good addition to existing Makefile, as well as CMake that we are going to add. Please see #19 for discussion around re-organizing libbpf-bootstrap to allow multiple languages (C and Rust for starters) and having multiple build system integrations. So let's wait for that reorg to be completed, and then work towards merging xmake stuff in. Does this sound good to you? |
ok, thanks! |
@waruqi now that we have both C and Rust examples, as well as Makefile and CMake-based build scripts, can you take another look if you can adopt your xmake stuff to integrate nicely into this setup? |
ok, I will look at it later. thanks. |
I have opened a pr to add xmake.lua for building linux/android program. #27 |
libbpf-bootstrap is a great project that allows beginners to quickly get started with bpf program development.
Now I used xmake to port the libbpf-bootstrap program and compiled it to the android platform.
xmake.lua
In addition, I ported the libbpf library and other dependent libraries to the android platform. All dependent packages and tool chains can be automatically downloaded and integrated by xmake.
We only need to execute
xmake
to compile linux bpf program, or usexmake f -p android; xmake
to compile android bpf program.If the user has installed the new version of llvm/clang and ndk r22, then xmake will also give priority to using them and will not download them automatically.
build on linux
It will download llvm toolchain and use it automatically if not found.
we can also install llvm manually.
sudo apt install llvm
and xmake will also use it.$ xmake
build android on linux
It will download ndk toolchain and use it automatically
We can also set ndk toolchain manually (need ndk >= r22)
Here is a libbpf-bootstrap project that I use xmake to ported. The project directory is very clean. We only need to keep the src source file and the xmake.lua project configuration file.
https://github.com/hack0z/libbpf-bootstrap
And I added libbpf package into our official repository, https://github.com/xmake-io/xmake-repo/blob/master/packages/l/libbpf/xmake.lua
If you are interested, I can open a pr and just add xmake.lua to your project, but I will not delete any other files, otherwise please ignore this issue.
Related issue: xmake-io/xmake#1274
Thanks!
The text was updated successfully, but these errors were encountered: