-
Notifications
You must be signed in to change notification settings - Fork 47
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
Cross-compilation is broken #94
Comments
I see that libbpf-sys is already using a mirrored repo of elfutils: https://github.com/libbpf/elfutils-mirror.git I think the best way to solve the cross-compilation failure is
autoreconf --install --force
./configure --disable-debuginfod --enable-maintainer-mode --without-zstd --disable-libdebuginfod
make -C lib libeu.a
make dist
git add -f libdw/known-dwarf.h libcpu/x86_64_dis.h libcpu/i386_dis.h
git commit -m "generate headers"
git push This way we have all the required generated headers and cross-compilation is working. |
I have created a cross-compilation friendly fork: https://github.com/kxxt/libbpf-sys-cross/tree/libbpf-sys-cross using the above workflow. But unfortunately I cannot really use it in my application because of rust-lang/cargo#9227 If this workflow can be accepted, please let me know and I will create a pull request. |
Very cool! Thanks for digging into this stuff and fixing it. Not the maintainer of
|
I don't think elfutils will fix their bug. This bug has been there for 14 years: https://lists.fedorahosted.org/archives/list/[email protected]/thread/TK47UHJMSDVHMJB5W4A3SLVKHLF7JEGA/
I totally agree with you. I will try to set up GitHub Actions to do that. But I probably won't be able to open a PR to against the mirror. The GitHub actions should be placed on a new orphan branch to avoid conflicts with upstream. And GitHub PR cannot do that.
Thanks!
Yes, the security report in my CI warns me about CVE-2024-25260 found in libbpf-sys so I updated elfutils to 0.191 |
I have get the GitHub Actions solution working. So here's how it works: The CI is updated to test cross-compilation for x86_64, aarch64 and riscv64 gnu targets.
I will open a PR to libbpf-sys after my previous PR is done: #93
libstdc++ is actually not required if we only build libelf. The build script build all the tool binaries() which not only wastes time and also pulls in C++ dependencies. I fixed it in kxxt#3 |
Why not We can just move the code of It is possible I am missing something else, of course.
This is great. Feel free to open a pull request. |
Yes, I wanted to do it that way in the first place as well.
That might be possible. But I am not sure how you want to do it in a cronjob.
That's not how GitHub Actions works. Initially I tried to create a workflow that runs on new tags. GitHub Actions uses the workflow file from whatever branch/tag it is running on instead of using the yml file from the default branch. If the branch/tag doesn't have the workflow yml file, the workflow won't run at all.
The workflow yaml file I am using now is a workflow_dispatch one that needs to be triggered manually. |
@danielocfb #95 for optimizing the build time. |
Well, now I think we no longer need to touch elfutils-mirror repo at all. The needed generated headers are only necessary when building libcpu, which is a library we actually don't need. I am changing #95 into a PR for fixing cross-compilation with static,vendored features. |
libbpf-sys cannot be cross-compiled.
default-features
There's no way to specify include path for cross-compilation. I opened #93 to fix it.
static, vendored
After I modify
build.rs
to pass--host aarch64-linux-gnu
toconfigure
, another error:This is an upstream bug(https://sourceware.org/bugzilla/show_bug.cgi?id=28891). Unfortunately, to fix it, we need to import upstream provided release tarballs into this repo instead of using git submodule. Is that acceptable?
The text was updated successfully, but these errors were encountered: