Skip to content

rust: diagnose bindgen empty-record alignment before building - #726

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
fix/default-config-bindgen-alignment
Oct 31, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
fix/default-config-bindgen-alignment

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

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.

RyanTheTide and others added 2 commits October 31, 2026 16:40
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>
@RyanTheTide
RyanTheTide merged commit 8866453 into aurora-wip Oct 31, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the fix/default-config-bindgen-alignment branch October 31, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant