From 14f337afb6fde2e847ea499bb6250a57a9660d48 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sat, 13 Aug 2022 02:47:31 -0700 Subject: [PATCH] lib/systems/inspect.nix: add isILP32 predicate I've run into a few packages that need an extra flag on platforms where `int` has more bits than `void*` does. I know of three such platforms: * [aarch64ilp32], used on both Linux and also on the [Apple Watch] * [x32], the x86 ILP32 ABI * [mips64n32], used on [Longsoon] and Cavium Octeon routers. This PR introduces a predicate so the package flags can be added in a generic way. [Apple Watch]: https://gist.github.com/woachk/943828f37c14563a607a26116435bf27#watch [mips64n32]: https://en.wikipedia.org/wiki/MIPS_architecture#Calling_conventions [Longsoon]: https://en.wikipedia.org/wiki/Loongson [x32]: https://en.wikipedia.org/wiki/X32_ABI --- lib/systems/inspect.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 4e0bb8e672e9..53d84118bd30 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -48,6 +48,7 @@ rec { is32bit = { cpu = { bits = 32; }; }; is64bit = { cpu = { bits = 64; }; }; + isILP32 = map (a: { abi = { abi = a; }; }) [ "n32" "ilp32" "x32" ]; isBigEndian = { cpu = { significantByte = significantBytes.bigEndian; }; }; isLittleEndian = { cpu = { significantByte = significantBytes.littleEndian; }; };