summary refs log tree commit diff
path: root/lib/systems/parse.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-02-20 20:32:52 -0800
committerAdam Joseph <adam@westernsemico.com>2022-03-10 20:30:16 -0800
commit12371a51e647a00b90fe250837f056642125c095 (patch)
tree7e46578a84ceb08b250e61be1516e3478c79b511 /lib/systems/parse.nix
parentb77a575dc8f825eb82d6a916fe01fe953d93033e (diff)
downloadnixpkgs-12371a51e647a00b90fe250837f056642125c095.tar
nixpkgs-12371a51e647a00b90fe250837f056642125c095.tar.gz
nixpkgs-12371a51e647a00b90fe250837f056642125c095.tar.bz2
nixpkgs-12371a51e647a00b90fe250837f056642125c095.tar.lz
nixpkgs-12371a51e647a00b90fe250837f056642125c095.tar.xz
nixpkgs-12371a51e647a00b90fe250837f056642125c095.tar.zst
nixpkgs-12371a51e647a00b90fe250837f056642125c095.zip
lib/systems: add mips64el definitions
MIPS has a large space of {architecture,abi,endianness}; this commit
adds all of them to lib/systems/platforms.nix so we can be done with
it.

Currently lib/systems/inspect.nix has a single "isMips" predicate,
which is a bit ambiguous now that we will have both mips32 and mips64
support, with the latter having two ABIs.  Let's add four new
predicates (isMips32, isMips64, isMips64n32, and isMips64n64) and
treat the now-ambiguous isMips as deprecated in favor of the
more-specific predicates.  These predicates are used mainly for
enabling/disabling target-specific workarounds, and it is extremely
rare that a platform-specific workaround is needed, and both mips32
and mips64 need exactly the same workaround.

The separate predicates (isMips64n32 and isMips64n64) for ABI
distinctions are, unfortunately, useful.  Boost's user-scheduled
threading (used by nix) does does not currently supports mips64n32,
which is a very desirable ABI on routers since they rarely have
more than 2**32 bytes of DRAM.
Diffstat (limited to 'lib/systems/parse.nix')
-rw-r--r--lib/systems/parse.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index f0e87c30e47..3ceddbb599b 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -359,6 +359,13 @@ rec {
       ];
     };
     gnuabi64     = { abi = "64"; };
+    muslabi64    = { abi = "64"; };
+
+    # NOTE: abi=n32 requires a 64-bit MIPS chip!  That is not a typo.
+    # It is basically the 64-bit abi with 32-bit pointers.  Details:
+    # https://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf
+    gnuabin32    = { abi = "n32"; };
+    muslabin32   = { abi = "n32"; };
 
     musleabi     = { float = "soft"; };
     musleabihf   = { float = "hard"; };