Skip to content

Conversation

@Gelbpunkt
Copy link
Contributor

@Gelbpunkt Gelbpunkt commented Dec 28, 2025

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_abiname set on PowerPC64(LE) targets. See the commit messages for details.

CC @RalfJung who pointed out the missing llvm_abiname validation

@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2025

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

@rustbot rustbot added 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 Dec 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2025

r? @chenyukang

rustbot has assigned @chenyukang.
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

@chenyukang
Copy link
Member

@rustbot reroll

@rustbot rustbot assigned jieyouxu and unassigned chenyukang Jan 13, 2026
@jieyouxu
Copy link
Member

@rustbot reroll

@rustbot rustbot assigned fee1-dead and unassigned jieyouxu Jan 13, 2026
…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.
@Gelbpunkt Gelbpunkt force-pushed the rustc-target-callconv-spec-elf-abi branch from 35377f3 to b2e1f69 Compare January 13, 2026 14:56
@rustbot
Copy link
Collaborator

rustbot commented Jan 13, 2026

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.

@Gelbpunkt Gelbpunkt force-pushed the rustc-target-callconv-spec-elf-abi branch from b2e1f69 to d40f0cd Compare January 13, 2026 15:33
… 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.
@Gelbpunkt Gelbpunkt force-pushed the rustc-target-callconv-spec-elf-abi branch from d40f0cd to 168f324 Compare January 15, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

6 participants