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

AArch64 support broken? #33

Open
rsdy opened this issue Feb 21, 2022 · 6 comments
Open

AArch64 support broken? #33

rsdy opened this issue Feb 21, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@rsdy
Copy link

rsdy commented Feb 21, 2022

With redbpf, we recently started migrating to libbpf-sys from our own wrapper that preceded this project. However, our CI quickly flagged up an error on aarch64, which I think we can only address by partially reverting to generating our own bindings to certain calls.

My question is whether we're mis-using libbpf-sys, or is this a known limitation? I couldn't find other than AMD64 compatibility in the CI.

I'd be happy to dig deeper on this, just wanted to get a confirmation if you have any experience on this front.

Thanks!

@alexforster
Copy link
Member

alexforster commented Feb 22, 2022

ARM is meant to be supported, and I regularly use this library on ARM. However, I run regenerate.sh on x86, and I definitely haven't tried to use any of the varargs bindings on ARM.

Fundamentally the issue is that bindgen is generating bindings for x86, and varargs implementations are ABI/cconv dependent. I think with this issue and with #27, there's a clear need to either pregenerate bindings specifically for different architectures and then conditionally compile in the right one, or to start generating bindings at cargo install time instead of pregenerating them.

@alexforster alexforster self-assigned this Feb 22, 2022
@alexforster alexforster added the enhancement New feature or request label Feb 22, 2022
@rsdy
Copy link
Author

rsdy commented Feb 23, 2022

Just looking through rebuild.sh, is there a reason this can't/shouldn't be done from build.rs? Would be one way to solve this by migrating the bpf-sys build.rs here, I don't see any fundamentally different processes.

@rsdy
Copy link
Author

rsdy commented Mar 15, 2022

@alexforster Any ideas on this? What's your preferred way of moving forward?

@anakryiko
Copy link
Member

@rsdy I'd say let's give it a try? Are you willing to prepare a PR with these changes?

@alexforster
Copy link
Member

alexforster commented Apr 11, 2022

As of the current release, you can now generate bindings during build time using a new feature flag called bindgen, like so:

libbpf_sys = { version = "...", features = ["bindgen"] }

Please let me know if this fixes your issue.

@jirutka
Copy link
Contributor

jirutka commented Oct 14, 2022

The latest libbpf-sys does build on aarch64, at least when cross-compiling, as you can see here.

I can’t examine your log, because: Error: The log was not found. It may have been deleted based on retention settings..

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

4 participants