lol

lib, treewide: Add missing MIPS arches, and fix existing usage

Existing "mips64el" should be "mipsel".

This is just the barest minimum so that nixpkgs can recognize them as
systems - although required for building individual derivations onto
MIPS boards, it is not sufficient if you want to actually build nixos on
those targets

authored by

Daniel Barlow and committed by
John Ericson
9c50ae68 2682ba63

+30 -19
+1 -1
doc/meta.xml
··· 53 53 "x86_64-linux", 54 54 "armv5tel-linux", 55 55 "armv7l-linux", 56 - "mips64el-linux", 56 + "mips32-linux", 57 57 "x86_64-darwin", 58 58 "i686-cygwin", 59 59 "i686-freebsd",
+1 -1
lib/systems/doubles.nix
··· 9 9 "aarch64-linux" 10 10 "armv5tel-linux" "armv6l-linux" "armv7l-linux" 11 11 12 - "mips64el-linux" 12 + "mipsel-linux" 13 13 14 14 "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd" 15 15
+1 -1
lib/systems/examples.nix
··· 51 51 }; 52 52 53 53 fuloongminipc = rec { 54 - config = "mips64el-unknown-linux-gnu"; 54 + config = "mipsel-unknown-linux-gnu"; 55 55 arch = "mips"; 56 56 float = "hard"; 57 57 platform = platforms.fuloong2f_n32;
+4 -1
lib/systems/parse.nix
··· 75 75 aarch64 = { bits = 64; significantByte = littleEndian; family = "aarch64"; }; 76 76 i686 = { bits = 32; significantByte = littleEndian; family = "x86"; }; 77 77 x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; }; 78 - mips64el = { bits = 32; significantByte = littleEndian; family = "mips"; }; 78 + mips = { bits = 32; significantByte = bigEndian; family = "mips"; }; 79 + mipsel = { bits = 32; significantByte = littleEndian; family = "mips"; }; 80 + mips64 = { bits = 64; significantByte = bigEndian; family = "mips"; }; 81 + mips64el = { bits = 64; significantByte = littleEndian; family = "mips"; }; 79 82 powerpc = { bits = 32; significantByte = bigEndian; family = "power"; }; 80 83 riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; }; 81 84 riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
+1 -1
lib/systems/platforms.nix
··· 561 561 "armv6l-linux" = raspberrypi; 562 562 "armv7l-linux" = armv7l-hf-multiplatform; 563 563 "aarch64-linux" = aarch64-multiplatform; 564 - "mips64el-linux" = fuloong2f_n32; 564 + "mipsel-linux" = fuloong2f_n32; 565 565 }.${system} or pcBase; 566 566 }
+2 -2
lib/tests/systems.nix
··· 16 16 17 17 arm = assertTrue (mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv7l-linux" ]); 18 18 i686 = assertTrue (mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" ]); 19 - mips = assertTrue (mseteq mips [ "mips64el-linux" ]); 19 + mips = assertTrue (mseteq mips [ "mipsel-linux" ]); 20 20 x86_64 = assertTrue (mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" ]); 21 21 22 22 cygwin = assertTrue (mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ]); ··· 24 24 freebsd = assertTrue (mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ]); 25 25 gnu = assertTrue (mseteq gnu (linux /* ++ hurd ++ kfreebsd ++ ... */)); 26 26 illumos = assertTrue (mseteq illumos [ "x86_64-solaris" ]); 27 - linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mips64el-linux" ]); 27 + linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mipsel-linux" ]); 28 28 netbsd = assertTrue (mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ]); 29 29 openbsd = assertTrue (mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]); 30 30 unix = assertTrue (mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));
+9 -2
pkgs/build-support/bintools-wrapper/default.nix
··· 58 58 else if (with targetPlatform; isArm && isLinux) then "${libc_lib}/lib/ld-linux*.so.3" 59 59 else if targetPlatform.system == "aarch64-linux" then "${libc_lib}/lib/ld-linux-aarch64.so.1" 60 60 else if targetPlatform.system == "powerpc-linux" then "${libc_lib}/lib/ld.so.1" 61 - else if targetPlatform.system == "mips64el-linux" then "${libc_lib}/lib/ld.so.1" 61 + else if targetPlatform.isMips then "${libc_lib}/lib/ld.so.1" 62 62 else if targetPlatform.isDarwin then "/usr/lib/dyld" 63 63 else if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" 64 64 else null; ··· 171 171 else if targetPlatform.isWindows then "pe" 172 172 else "elf" + toString targetPlatform.parsed.cpu.bits; 173 173 endianPrefix = if targetPlatform.isBigEndian then "big" else "little"; 174 + sep = optionalString (targetPlatform.isx86 || targetPlatform.isArm) "-"; 174 175 arch = 175 176 /**/ if targetPlatform.isAarch64 then endianPrefix + "aarch64" 176 177 else if targetPlatform.isArm then endianPrefix + "arm" 177 178 else if targetPlatform.isx86_64 then "x86-64" 178 179 else if targetPlatform.isi686 then "i386" 180 + else if targetPlatform.isMips then { 181 + "mips" = "btsmipn32"; # n32 variant 182 + "mipsel" = "ltsmipn32"; # n32 variant 183 + "mips64" = "btsmip"; 184 + "mips64el" = "ltsmip"; 185 + }.${targetPlatform.parsed.cpu.name} 179 186 else throw "unknown emulation for platform: " + targetPlatform.config; 180 - in targetPlatform.platform.bfdEmulation or (fmt + "-" + arch); 187 + in targetPlatform.platform.bfdEmulation or (fmt + sep + arch); 181 188 182 189 depsTargetTargetPropagated = extraPackages; 183 190
+2 -2
pkgs/development/compilers/gcc/4.5/default.nix
··· 317 317 318 318 # Platform-specific flags 319 319 optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ 320 - # Trick that should be taken out once we have a mips64el-linux not loongson2f 321 - optional (targetPlatform == hostPlatform && stdenv.system == "mips64el-linux") "--with-arch=loongson2f" 320 + # Trick that should be taken out once we have a mipsel-linux not loongson2f 321 + optional (targetPlatform == hostPlatform && stdenv.system == "mipsel-linux") "--with-arch=loongson2f" 322 322 ; 323 323 324 324 targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
+1 -2
pkgs/development/tools/misc/pkgconfig/default.nix
··· 19 19 patches = optional (!vanilla) ./requires-private.patch 20 20 ++ optional stdenv.isCygwin ./2.36.3-not-win32.patch; 21 21 22 - preConfigure = optionalString (stdenv.system == "mips64el-linux") 23 - ''cp -v ${automake}/share/automake*/config.{sub,guess} .''; 22 + preConfigure = ""; # TODO(@Ericson2314): Remove next mass rebuild 24 23 buildInputs = optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv; 25 24 26 25 configureFlags = [ "--with-internal-glib" ]
+1 -1
pkgs/os-specific/linux/kbd/default.nix
··· 32 32 33 33 # We get a warning in armv5tel-linux and the fuloong2f, so we 34 34 # disable -Werror in it. 35 - ${stdenv.lib.optionalString (stdenv.isArm || stdenv.system == "mips64el-linux") '' 35 + ${stdenv.lib.optionalString (stdenv.isArm || stdenv.hostPlatform.isMips) '' 36 36 sed -i s/-Werror// src/Makefile.am 37 37 ''} 38 38 '';
+3 -1
pkgs/stdenv/adapters.nix
··· 94 94 # without proper `file` command, libtool sometimes fails 95 95 # to recognize 64-bit DLLs 96 96 ++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file 97 - ++ stdenv.lib.optional (hostPlatform.isAarch64 || hostPlatform.libc == "musl") pkgs.updateAutotoolsGnuConfigScriptsHook 97 + ++ stdenv.lib.optional 98 + (hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl") 99 + pkgs.updateAutotoolsGnuConfigScriptsHook 98 100 ; 99 101 100 102 crossConfig = hostPlatform.config;
+1 -1
pkgs/stdenv/default.nix
··· 45 45 "armv6l-linux" = stagesLinux; 46 46 "armv7l-linux" = stagesLinux; 47 47 "aarch64-linux" = stagesLinux; 48 - "mips64el-linux" = stagesLinux; 48 + "mipsel-linux" = stagesLinux; 49 49 "powerpc-linux" = /* stagesLinux */ stagesNative; 50 50 "x86_64-darwin" = stagesDarwin; 51 51 "x86_64-solaris" = stagesNix;
+2 -2
pkgs/stdenv/linux/default.nix
··· 15 15 "armv6l-linux" = import ./bootstrap-files/armv6l.nix; 16 16 "armv7l-linux" = import ./bootstrap-files/armv7l.nix; 17 17 "aarch64-linux" = import ./bootstrap-files/aarch64.nix; 18 - "mips64el-linux" = import ./bootstrap-files/loongson2f.nix; 18 + "mipsel-linux" = import ./bootstrap-files/loongson2f.nix; 19 19 }; 20 20 "musl" = { 21 21 "aarch64-linux" = import ./bootstrap-files/aarch64-musl.nix; ··· 40 40 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 41 41 export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" 42 42 ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""} 43 - ${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} 43 + ${if system == "mipsel-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} 44 44 ''; 45 45 46 46
+1 -1
pkgs/top-level/all-packages.nix
··· 5442 5442 xbursttools = assert stdenv ? glibc; callPackage ../tools/misc/xburst-tools rec { 5443 5443 # It needs a cross compiler for mipsel to build the firmware it will 5444 5444 # load into the Ben Nanonote 5445 - crossPrefix = "mips64el-unknown-linux-gnu"; 5445 + crossPrefix = "mipsel-unknown-linux-gnu"; 5446 5446 gccCross = 5447 5447 let 5448 5448 pkgsCross = nixpkgsFun {