Generate 64-bit and 32-bit bindings#111
Merged
l0kod merged 1 commit intolandlock-lsm:mainfrom Oct 21, 2025
Merged
Conversation
Closed
Contributor
|
Wouldn't this break all non x86/x86_64 archs? |
Member
Author
Yes, but it gives guarantee that we tested with these archs. I was also thinking about adding two generic 32-bit and 64-bit bindings without tests, but I'm not sure if that would be correct for most/all other archs. |
Member
Author
|
I tested with ARM 32-bit and 64-bit (which always have 8-bytes alignment) and the new |
Until now, we only used the x86_64 architecture, but here are the changes to use this crate on any architecture. Add the bindgen.sh script to make update simple: ./src/uapi/bindgen.sh .../linux-6.12 This call creates three binding files: - landlock_x86_64.rs - landlock_i686.rs - landlock_all.rs Only landlock_all.rs is generated without memory layout tests to make it architecture-agnostic. For instance, x86_64-linux-gnu (64-bit), aarch64-unknown-linux-gnu (64-bit), and armv7-unknown-linux-gnueabi (32-bit) all align memory on 8 bytes, which is not the case for i686-linux-gnu (32-bit). This makes i686 tests incompatible for bindgen_test_layout_landlock_ruleset_attr() and bindgen_test_layout_landlock_net_port_attr(). Extend the CI to build and test on i686. Closes: landlock-lsm#110 Signed-off-by: Mickaël Salaün <mic@digikod.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #110