-
Notifications
You must be signed in to change notification settings - Fork 699
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
alignas
alignment is not respected on Linux 32-bit
#917
Comments
Oh, |
No, I don't think that's quite it... What I know so far is that without
With
|
So this is really kind of Rust bug. Rust thinks alignment of |
Filed rust-lang/rust#43899 for the issue. |
That issue has more context, this is, I think, not a bindgen bug. We could work around it using |
So I think another workaround is to move around fields in |
We moved around the fields in |
How can it pack better for small T? IIRC the result should not change, because the bool needs to be put at the aligned place of T as well. I believe for |
Ah, re-looking at bug 1287006, I see that part of the issue was that we had an over-aligned storage for |
Oh wait, that wouldn't help actually. The issue isn't about packing, actually, it is about So one solution is to test the alignment in a struct rather than as its own. I'll submit a patch to Gecko side and see if that helps. |
I closed the Rust bug, because it seems that The issue here is actually that the code use In the mean time, I think we can change |
I found that Rust stablized |
codegen: Support repr(align) Fixes #917.
codegen: Support repr(align) Fixes #917.
Input C/C++ Header
Bindgen Invocation
Actual Results
This layout test fails on Linux 32-bit:
because Rust believes the alignment should be 4 bytes.
alignas
is trying to mandate 8 bytes, but Rust doesn't seem to agree.Expected Results
This is currently blocking Stylo from working on Linux 32-bit, see https://bugzilla.mozilla.org/show_bug.cgi?id=1366050#c49.
The text was updated successfully, but these errors were encountered: