git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #35247 from telent/mips32

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

commitdfc5d7835d6e248d3cc83430da941277ae5cabaa authorJohn Ericson <Ericson2314@yahoo.com> dateTue 27 Feb 2018, 14:01 (9 years ago) parentac4e65c9c50ae6
14 files changed+30−19
doc/meta.xml+1−1 lib/systems/doubles.nix+1−1 lib/systems/examples.nix+1−1 lib/systems/parse.nix+4−1 lib/systems/platforms.nix+1−1 lib/tests/systems.nix+2−2 pkgs/build-support/bintools-wrapper/default.nix+9−2 pkgs/development/compilers/gcc/4.5/default.nix+2−2 pkgs/development/tools/misc/pkgconfig/default.nix+1−2 pkgs/os-specific/linux/kbd/default.nix+1−1 pkgs/stdenv/adapters.nix+3−1 pkgs/stdenv/default.nix+1−1 pkgs/stdenv/linux/default.nix+2−2 pkgs/top-level/all-packages.nix+1−1
doc/meta.xml+1−1
@@ -53,7 +53,7 @@ $ nix-env -qa hello --json
5353 "x86_64-linux",
5454 "armv5tel-linux",
5555 "armv7l-linux",
56− "mips64el-linux",
56+ "mips32-linux",
5757 "x86_64-darwin",
5858 "i686-cygwin",
5959 "i686-freebsd",
lib/systems/doubles.nix+1−1
@@ -9,7 +9,7 @@ let
99 "aarch64-linux"
1010 "armv5tel-linux" "armv6l-linux" "armv7l-linux"
1111
12− "mips64el-linux"
12+ "mipsel-linux"
1313
1414 "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd"
1515
lib/systems/examples.nix+1−1
@@ -51,7 +51,7 @@ rec {
5151 };
5252
5353 fuloongminipc = rec {
54− config = "mips64el-unknown-linux-gnu";
54+ config = "mipsel-unknown-linux-gnu";
5555 arch = "mips";
5656 float = "hard";
5757 platform = platforms.fuloong2f_n32;
lib/systems/parse.nix+4−1
@@ -75,7 +75,10 @@ rec {
7575 aarch64 = { bits = 64; significantByte = littleEndian; family = "aarch64"; };
7676 i686 = { bits = 32; significantByte = littleEndian; family = "x86"; };
7777 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"; };
7982 powerpc = { bits = 32; significantByte = bigEndian; family = "power"; };
8083 riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; };
8184 riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
lib/systems/platforms.nix+1−1
@@ -561,6 +561,6 @@ rec {
561561 "armv6l-linux" = raspberrypi;
562562 "armv7l-linux" = armv7l-hf-multiplatform;
563563 "aarch64-linux" = aarch64-multiplatform;
564− "mips64el-linux" = fuloong2f_n32;
564+ "mipsel-linux" = fuloong2f_n32;
565565 }.${system} or pcBase;
566566}
lib/tests/systems.nix+2−2
@@ -16,7 +16,7 @@ in with lib.systems.doubles; lib.runTests {
1616
1717 arm = assertTrue (mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv7l-linux" ]);
1818 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" ]);
2020 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" ]);
2121
2222 cygwin = assertTrue (mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ]);
@@ -24,7 +24,7 @@ in with lib.systems.doubles; lib.runTests {
2424 freebsd = assertTrue (mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ]);
2525 gnu = assertTrue (mseteq gnu (linux /* ++ hurd ++ kfreebsd ++ ... */));
2626 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" ]);
2828 netbsd = assertTrue (mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ]);
2929 openbsd = assertTrue (mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]);
3030 unix = assertTrue (mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));
pkgs/build-support/bintools-wrapper/default.nix+9−2
@@ -58,7 +58,7 @@ let
5858 else if (with targetPlatform; isArm && isLinux) then "${libc_lib}/lib/ld-linux*.so.3"
5959 else if targetPlatform.system == "aarch64-linux" then "${libc_lib}/lib/ld-linux-aarch64.so.1"
6060 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"
6262 else if targetPlatform.isDarwin then "/usr/lib/dyld"
6363 else if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1"
6464 else null;
@@ -171,13 +171,20 @@ stdenv.mkDerivation {
171171 else if targetPlatform.isWindows then "pe"
172172 else "elf" + toString targetPlatform.parsed.cpu.bits;
173173 endianPrefix = if targetPlatform.isBigEndian then "big" else "little";
174+ sep = optionalString (targetPlatform.isx86 || targetPlatform.isArm) "-";
174175 arch =
175176 /**/ if targetPlatform.isAarch64 then endianPrefix + "aarch64"
176177 else if targetPlatform.isArm then endianPrefix + "arm"
177178 else if targetPlatform.isx86_64 then "x86-64"
178179 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}
179186 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);
181188
182189 depsTargetTargetPropagated = extraPackages;
183190
pkgs/development/compilers/gcc/4.5/default.nix+2−2
@@ -317,8 +317,8 @@ stdenv.mkDerivation ({
317317
318318 # Platform-specific flags
319319 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"
322322 ;
323323
324324 targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
pkgs/development/tools/misc/pkgconfig/default.nix+1−2
@@ -19,8 +19,7 @@ stdenv.mkDerivation rec {
1919 patches = optional (!vanilla) ./requires-private.patch
2020 ++ optional stdenv.isCygwin ./2.36.3-not-win32.patch;
2121
22− preConfigure = optionalString (stdenv.system == "mips64el-linux")
23− ''cp -v ${automake}/share/automake*/config.{sub,guess} .'';
22+ preConfigure = ""; # TODO(@Ericson2314): Remove next mass rebuild
2423 buildInputs = optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv;
2524
2625 configureFlags = [ "--with-internal-glib" ]
pkgs/os-specific/linux/kbd/default.nix+1−1
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
3232
3333 # We get a warning in armv5tel-linux and the fuloong2f, so we
3434 # disable -Werror in it.
35− ${stdenv.lib.optionalString (stdenv.isArm || stdenv.system == "mips64el-linux") ''
35+ ${stdenv.lib.optionalString (stdenv.isArm || stdenv.hostPlatform.isMips) ''
3636 sed -i s/-Werror// src/Makefile.am
3737 ''}
3838 '';
pkgs/stdenv/adapters.nix+3−1
@@ -94,7 +94,9 @@ rec {
9494 # without proper `file` command, libtool sometimes fails
9595 # to recognize 64-bit DLLs
9696 ++ 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
98100 ;
99101
100102 crossConfig = hostPlatform.config;
pkgs/stdenv/default.nix+1−1
@@ -45,7 +45,7 @@ in
4545 "armv6l-linux" = stagesLinux;
4646 "armv7l-linux" = stagesLinux;
4747 "aarch64-linux" = stagesLinux;
48− "mips64el-linux" = stagesLinux;
48+ "mipsel-linux" = stagesLinux;
4949 "powerpc-linux" = /* stagesLinux */ stagesNative;
5050 "x86_64-darwin" = stagesDarwin;
5151 "x86_64-solaris" = stagesNix;
pkgs/stdenv/linux/default.nix+2−2
@@ -15,7 +15,7 @@
1515 "armv6l-linux" = import ./bootstrap-files/armv6l.nix;
1616 "armv7l-linux" = import ./bootstrap-files/armv7l.nix;
1717 "aarch64-linux" = import ./bootstrap-files/aarch64.nix;
18− "mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
18+ "mipsel-linux" = import ./bootstrap-files/loongson2f.nix;
1919 };
2020 "musl" = {
2121 "aarch64-linux" = import ./bootstrap-files/aarch64-musl.nix;
@@ -40,7 +40,7 @@ let
4040 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
4141 export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
4242 ${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 ""}
4444 '';
4545
4646
pkgs/top-level/all-packages.nix+1−1
@@ -5474,7 +5474,7 @@ with pkgs;
54745474 xbursttools = assert stdenv ? glibc; callPackage ../tools/misc/xburst-tools rec {
54755475 # It needs a cross compiler for mipsel to build the firmware it will
54765476 # load into the Ben Nanonote
5477− crossPrefix = "mips64el-unknown-linux-gnu";
5477+ crossPrefix = "mipsel-unknown-linux-gnu";
54785478 gccCross =
54795479 let
54805480 pkgsCross = nixpkgsFun {