Skip to content

compiler: Fix "power alignment" problems on AIX #142310

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

workingjubilee
Copy link
Member

Hello, this is a localized rustc-focused fix for the AIX "power alignment" issue. It does not fix upstream because I expect that to be a more annoying experience and would take some time to propagate into the release. I mostly wish to remove the "power alignment" lint so we do not have to work it into updates to the "improper-ctypes" lint, but it feels wrong to do so without actually fixing the codegen issue, especially since it's such a small change.

cc @daltenty @gilamn5tr @mustartt @amy-kwan Can you confirm whether this change allows rustc to do FFI correctly with C code compiled using the default AIX ABI?

@rustbot
Copy link
Collaborator

rustbot commented Jun 10, 2025

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 10, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 10, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@rust-log-analyzer

This comment has been minimized.

This lint was based on a false premise: LLVM lacks a correct datalayout,
but rustc assumed that the AIX datalayout was correct.
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

It does not fix upstream

I assume you are referring to llvm/llvm-project#133599 here? Always good to leave some cross-references. :)

Please also add comments in the code referencing that (both in the aix target triple, and the special exception for the data layout consistency check). Right now, just looking at the code after applying this diff, one would have a very hard time figuring out what happens.

@workingjubilee
Copy link
Member Author

aye aye capitan

@RalfJung
Copy link
Member

As discussed on IRLO, as-is this patch would make some types more correct and others less correct. Hard to say whether that's overall a net positive...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants