From eabc6d2902f792064890a8fd48c6078e68248da4 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Wed, 27 Apr 2022 23:40:29 -0700 Subject: lib/systems/platforms.nix: fix broken mips32 detection Prior to this commit, nixpkgs would assume that every little-endian mips32 system was a "fuloong2f_n32". Not only are there plenty of mips32 chips other than the fuloong, but the fuloong is actually a mips64 chip! Note that the "n32" ABI is (confusingly) an ABI for 64-bit mips chips (like the "x32" ABI for amd64 chips -- both are ABIs which use 32-bit pointers on an otherwise-64-bit system). This error causes far-ranging problems. One of them was particularly difficult to track down: it caused GCC to select 128-bit `long double` types, which is invalid for the mips32 ABI. This isn't noticed until you try to build musl-libc, which is careful to check for these things. Prior to this commit, nix-build . -A pkgsCross.mipsel-linux-gnu.pkgsStatic.hello would fail. With this commit and #170736, it succeeds. --- lib/systems/platforms.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index d65ff6487b7ad..5290b67cde8a8 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -564,7 +564,7 @@ rec { else if platform.isRiscV then riscv-multiplatform - else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then fuloong2f_n32 + else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then (import ./examples.nix { lib = lib; }).mipsel-linux-gnu else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv -- cgit 1.4.1 From 4d46ee8691f11a7c7f4592fb645b4ba4c49dfbe2 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 28 Apr 2022 03:52:15 -0700 Subject: platforms.nix: use `inherit` syntax --- lib/systems/platforms.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 5290b67cde8a8..447a02458257a 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -564,7 +564,7 @@ rec { else if platform.isRiscV then riscv-multiplatform - else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then (import ./examples.nix { lib = lib; }).mipsel-linux-gnu + else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then (import ./examples.nix { inherit lib; }).mipsel-linux-gnu else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv -- cgit 1.4.1