Repository navigation
rust: diagnose bindgen empty-record alignment before building - #726
Merged
Merged
Conversation
An unprepared source tree falls back to bindgen on PATH. Stock bindgen loses the alignment of a defined empty GNU C struct, so the default Asahi configuration fails the sched_statistics layout assertion. The existing pinned generator repairs this, but the availability check does not explain that it must be prepared before configuring the kernel. Probe the selected generator's behavior rather than its version and point to the pinned build recipe. Keep this a warning so configuration cannot silently remove Rust drivers. Every generated kernel layout assertion remains enabled. Cover patched and unpatched tools with the same version and a failed probe that emits partial output. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This was referenced Nov 2, 2026
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.
An unprepared source tree falls back to bindgen on PATH. Stock bindgen can lose the alignment of an empty GNU C struct and fail later at the sched_statistics layout assertion. The existing pinned generator repairs this, but the availability check does not explain that it must be prepared before configuration.
Probe the selected generator's alignment behavior and print the existing preparation command. Keep this a warning so configuration cannot silently remove Rust drivers, and retain all generated layout assertions. Add regression coverage for patched and unpatched tools with the same version, and for a failed probe that emits partial output.
Tested commit a2902bb after merging aurora-wip: an arm64 cross-build of defconfig + asahi.config retained CONFIG_RUST=y and CONFIG_SCHEDSTATS=n, and built Image and 1,751 modules. All 35 availability tests and the pinned generator's compile-only fixtures passed with Rust 1.96.0 and Clang 22.1.6. Build status.
Image SHA-256: 4043f50c9429323871953345925d69d656d2a03252dfc91dd8460dbc73fba04f.