lib/systems: use Darwin architecture names for config and uname

`aarch64-apple-darwin` no longer works with LLVM 20.
This commit is contained in:
Emily
2025-03-25 21:54:53 +00:00
parent 1e6ab3434f
commit 61582c7043
9 changed files with 28 additions and 31 deletions

View File

@@ -209,6 +209,8 @@ let
"ppc${optionalString final.isLittleEndian "le"}"
else if final.isMips64 then
"mips64" # endianness is *not* included on mips64
else if final.isDarwin then
final.darwinArch
else
final.parsed.cpu.name;
@@ -329,12 +331,7 @@ let
else
final.parsed.cpu.name;
darwinArch =
{
armv7a = "armv7";
aarch64 = "arm64";
}
.${final.parsed.cpu.name} or final.parsed.cpu.name;
darwinArch = parse.darwinArch final.parsed.cpu;
darwinPlatform =
if final.isMacOS then
@@ -488,8 +485,8 @@ let
}
.${cpu.name} or cpu.name;
vendor_ = final.rust.platform.vendor;
# TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
in
# TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
args.rust.rustcTarget or args.rustc.config or (
# Rust uses `wasm32-wasip?` rather than `wasm32-unknown-wasi`.
# We cannot know which subversion does the user want, and

View File

@@ -276,7 +276,7 @@ rec {
#
iphone64 = {
config = "aarch64-apple-ios";
config = "arm64-apple-ios";
# config = "aarch64-apple-darwin14";
darwinSdkVersion = "14.3";
xcodeVer = "12.3";
@@ -295,7 +295,7 @@ rec {
};
aarch64-darwin = {
config = "aarch64-apple-darwin";
config = "arm64-apple-darwin";
xcodePlatform = "MacOSX";
platform = { };
};

View File

@@ -396,6 +396,12 @@ rec {
significantByte = littleEndian;
family = "javascript";
};
}
// {
# aliases
# Apple architecture name, as used by `darwinArch`; required by
# LLVM ≥ 20.
arm64 = cpuTypes.aarch64;
};
# GNU build systems assume that older NetBSD architectures are using a.out.
@@ -921,6 +927,8 @@ rec {
kernelName = kernel: kernel.name + toString (kernel.version or "");
darwinArch = cpu: if cpu.name == "aarch64" then "arm64" else cpu.name;
doubleFromSystem =
{
cpu,
@@ -949,8 +957,9 @@ rec {
kernel.name == "netbsd" && gnuNetBSDDefaultExecFormat cpu != kernel.execFormat
) kernel.execFormat.name;
optAbi = optionalString (abi != abis.unknown) "-${abi.name}";
cpuName = if kernel.families ? darwin then darwinArch cpu else cpu.name;
in
"${cpu.name}-${vendor.name}-${kernelName kernel}${optExecFormat}${optAbi}";
"${cpuName}-${vendor.name}-${kernelName kernel}${optExecFormat}${optAbi}";
################################################################################