-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing #150468
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
base: main
Are you sure you want to change the base?
rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing #150468
Conversation
|
These commits modify compiler targets. |
|
r? @chenyukang rustbot has assigned @chenyukang. Use |
2106bd3 to
35377f3
Compare
|
@rustbot reroll |
|
@rustbot reroll |
…instead of guessing All PowerPC64 targets except AIX explicitly set the ABI in the target options. We can therefore stop hardcoding the ABI to be used based on the target environment or OS, except for the AIX special case. The fallback based on endianness is kept for the sake of compatibility with custom targets. This makes it so that big endian targets not explicitly accounted for before (powerpc64-unknown-openbsd) and targets that don't use the expected default ABI (ELFv2 Glibc targets) use the correct ABI in the calling convention code.
35377f3 to
b2e1f69
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
b2e1f69 to
d40f0cd
Compare
… PowerPC64(LE) PowerPC64 ELF targets (effectively anything that isn't AIX) use either the ELFv1 or ELFv2 ABI. The ELFv1 ABI is only specified for big endian targets, while ELFv2 can be used by both little- and big-endian targets. Make sure that, if an LLVM ABI is set, it is set to one of the two. AIX does not set an LLVM ABI name, so ensure that AIX targets don't set anything other than an empty ABI name.
d40f0cd to
168f324
Compare
All PowerPC64 targets except AIX explicitly set the ABI in the target options. We can therefore stop hardcoding the ABI to be used based on the target environment or OS, except for the AIX special case.
The fallback based on endianness is kept for the sake of compatibility with custom targets.
This makes it so that big endian targets not explicitly accounted for before (powerpc64-unknown-openbsd) and targets that don't use the expected default ABI (big-endian ELFv2 Glibc targets) use the correct ABI in the calling convention code.
The second commit is a tiny change to validate the
llvm_abinameset on PowerPC64(LE) targets. See the commit messages for details.CC @RalfJung who pointed out the missing
llvm_abinamevalidation