diff options
| author | Emily <vcs@emily.moe> | 2025-03-25 21:54:53 +0000 |
|---|---|---|
| committer | Emily <vcs@emily.moe> | 2025-04-02 21:22:47 +0100 |
| commit | 61582c704327002b75d61354a769ebf00f594cdf (patch) | |
| tree | 6a4ddd35ced218fdab6aa90ae8f38071292a2893 /lib | |
| parent | treewide: drop support for 32‐bit Darwin (diff) | |
| download | nixpkgs-61582c704327002b75d61354a769ebf00f594cdf.tar.gz | |
lib/systems: use Darwin architecture names for `config` and `uname`
`aarch64-apple-darwin` no longer works with LLVM 20.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/systems/default.nix | 11 | ||||
| -rw-r--r-- | lib/systems/examples.nix | 4 | ||||
| -rw-r--r-- | lib/systems/parse.nix | 11 |
3 files changed, 16 insertions, 10 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 5e16240e4263..97f3d0dced17 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -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 diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index f87162e83277..3988e39f150c 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -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 = { }; }; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index a7f65e69bf4c..ec773c824def 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -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}"; ################################################################################ |
