lib.systems: Simplify ABI on POWER for rust.rustcTarget (#451087)

This commit is contained in:
Alyssa Ross
2025-10-25 09:57:09 +00:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
+8 -1
View File
@@ -491,6 +491,13 @@ let
}
.${cpu.name} or cpu.name;
vendor_ = final.rust.platform.vendor;
abi_ =
# We're very explicit about the POWER ELF ABI w/ glibc in our parsing, while Rust is not.
# TODO: Somehow ensure that Rust actually *uses* the correct ABI, and not just a libc-based default.
if (lib.strings.hasPrefix "powerpc" cpu.name) && (lib.strings.hasPrefix "gnuabielfv" abi.name) then
"gnu"
else
abi.name;
in
# TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
args.rust.rustcTarget or args.rustc.config or (
@@ -501,7 +508,7 @@ let
if final.isWasi then
"${cpu_}-wasip1"
else
"${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi.name}"}"
"${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi_}"}"
);
# The name of the rust target if it is standard, or the json file
-1
View File
@@ -23,7 +23,6 @@ rec {
ppc64-elfv1 = {
config = "powerpc64-unknown-linux-gnuabielfv1";
rust.rustcTarget = "powerpc64-unknown-linux-gnu";
};
ppc64-elfv2 = {
config = "powerpc64-unknown-linux-gnuabielfv2";