From d501f960a3950983725a94f4ec7e83f3149e13f2 Mon Sep 17 00:00:00 2001 From: Aelin Reidel Date: Tue, 24 Feb 2026 07:37:34 +0100 Subject: [PATCH] rustc_target: callconv: powerpc64: Use llvm_abiname rather than target_abi for ABI determination Currently on PowerPC64 targets, llvm_abiname and target_abi will be the same unless we're on AIX. Since llvm_abiname is what we pass on to LLVM, it is preferable to use the value of that to determine the calling convention rather than target_abi. All PowerPC64 targets set both llvm_abiname and target_abi to the respective ELF ABIs, with the exception of AIX. This is a non-functional change. --- compiler/rustc_target/src/callconv/powerpc64.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_target/src/callconv/powerpc64.rs b/compiler/rustc_target/src/callconv/powerpc64.rs index 1d83799d7dab1..683b615eec83b 100644 --- a/compiler/rustc_target/src/callconv/powerpc64.rs +++ b/compiler/rustc_target/src/callconv/powerpc64.rs @@ -5,7 +5,7 @@ use rustc_abi::{Endian, HasDataLayout, TyAbiInterface}; use crate::callconv::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform}; -use crate::spec::{Abi, HasTargetSpec, Os}; +use crate::spec::{HasTargetSpec, Os}; #[derive(Debug, Clone, Copy, PartialEq)] enum ABI { @@ -106,9 +106,9 @@ where Ty: TyAbiInterface<'a, C> + Copy, C: HasDataLayout + HasTargetSpec, { - let abi = if cx.target_spec().options.abi == Abi::ElfV2 { + let abi = if cx.target_spec().options.llvm_abiname == "elfv2" { ELFv2 - } else if cx.target_spec().options.abi == Abi::ElfV1 { + } else if cx.target_spec().options.llvm_abiname == "elfv1" { ELFv1 } else if cx.target_spec().os == Os::Aix { AIX