From 222c569b76ba091c7253c81707705a00a1596654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 20 Mar 2022 22:02:37 +0100 Subject: [PATCH 1/3] platforms.linux: add mips-linux and mips64-linux --- lib/systems/doubles.nix | 1 + lib/tests/systems.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 27cdaf6a7233b..8fe9319e5eff1 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -28,6 +28,7 @@ let "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "m68k-linux" "mipsel-linux" "mips64el-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" + "mips-linux" "mips64-linux" "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux" # MMIXware diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index c88adbf4651aa..9a61305711c88 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -17,7 +17,7 @@ with lib.systems.doubles; lib.runTests { testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-netbsd" "armv6l-none" "armv7a-linux" "armv7a-netbsd" "armv7l-linux" "armv7l-netbsd" "arm-none" "armv7a-darwin" ]; testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-genode" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ]; - testmips = mseteq mips [ "mips64el-linux" "mipsel-linux" "mipsel-netbsd" ]; + testmips = mseteq mips [ "mips-linux" "mips64-linux" "mips64el-linux" "mipsel-linux" "mipsel-netbsd" ]; testmmix = mseteq mmix [ "mmix-mmixware" ]; testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ]; @@ -28,7 +28,7 @@ with lib.systems.doubles; lib.runTests { testredox = mseteq redox [ "x86_64-redox" ]; testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */); testillumos = mseteq illumos [ "x86_64-solaris" ]; - testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" ]; + testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" "mips-linux" "mips64-linux" ]; testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ]; testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]; testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ]; From 9f4ef900aa1e6bdcb929f83d2a93819f1df04cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 20 Mar 2022 22:12:45 +0100 Subject: [PATCH 2/3] go_1_{17,18}: add mips64 as platform --- pkgs/development/compilers/go/1.17.nix | 1 + pkgs/development/compilers/go/1.18.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/development/compilers/go/1.17.nix b/pkgs/development/compilers/go/1.17.nix index 69537dc899e82..a3338c1287a23 100644 --- a/pkgs/development/compilers/go/1.17.nix +++ b/pkgs/development/compilers/go/1.17.nix @@ -46,6 +46,7 @@ let "s390x" = "s390x"; "powerpc64le" = "ppc64le"; "mips64el" = "mips64le"; + "mips64" = "mips64"; }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); # We need a target compiler which is still runnable at build time, diff --git a/pkgs/development/compilers/go/1.18.nix b/pkgs/development/compilers/go/1.18.nix index a4cb013d94f24..24a624d86cde9 100644 --- a/pkgs/development/compilers/go/1.18.nix +++ b/pkgs/development/compilers/go/1.18.nix @@ -46,6 +46,7 @@ let "s390x" = "s390x"; "powerpc64le" = "ppc64le"; "mips64el" = "mips64le"; + "mips64" = "mips64"; }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); # We need a target compiler which is still runnable at build time, From 73d4e5feb1576df5dc581e24d06ad677be1bb7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 21 Mar 2022 09:50:05 +0100 Subject: [PATCH 3/3] make various mips targets as broken --- lib/systems/examples.nix | 3 +++ lib/systems/platforms.nix | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 997a7a8c273ae..138421254c188 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -98,18 +98,21 @@ rec { # can execute on 32bit chip mips-linux-gnu = { config = "mips-linux-gnu"; } // platforms.gcc_mips32r2_o32; mipsel-linux-gnu = { config = "mipsel-linux-gnu"; } // platforms.gcc_mips32r2_o32; + # The targets below are not usable yet. i.e don't evaluate mipsisa32r6-linux-gnu = { config = "mipsisa32r6-linux-gnu"; } // platforms.gcc_mips32r6_o32; mipsisa32r6el-linux-gnu = { config = "mipsisa32r6el-linux-gnu"; } // platforms.gcc_mips32r6_o32; # require 64bit chip (for more registers, 64-bit floating point, 64-bit "long long") but use 32bit pointers mips64-linux-gnuabin32 = { config = "mips64-linux-gnuabin32"; } // platforms.gcc_mips64r2_n32; mips64el-linux-gnuabin32 = { config = "mips64el-linux-gnuabin32"; } // platforms.gcc_mips64r2_n32; + # The targets below are not usable yet. i.e don't evaluate mipsisa64r6-linux-gnuabin32 = { config = "mipsisa64r6-linux-gnuabin32"; } // platforms.gcc_mips64r6_n32; mipsisa64r6el-linux-gnuabin32 = { config = "mipsisa64r6el-linux-gnuabin32"; } // platforms.gcc_mips64r6_n32; # 64bit pointers mips64-linux-gnuabi64 = { config = "mips64-linux-gnuabi64"; } // platforms.gcc_mips64r2_64; mips64el-linux-gnuabi64 = { config = "mips64el-linux-gnuabi64"; } // platforms.gcc_mips64r2_64; + # The targets below are not usable yet. i.e don't evaluate mipsisa64r6-linux-gnuabi64 = { config = "mipsisa64r6-linux-gnuabi64"; } // platforms.gcc_mips64r6_64; mipsisa64r6el-linux-gnuabi64 = { config = "mipsisa64r6el-linux-gnuabi64"; } // platforms.gcc_mips64r6_64; diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 04d55416242e1..5437db1d175ca 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -490,8 +490,8 @@ rec { }; # can execute on 32bit chip - gcc_mips32r2_o32 = { gcc = { arch = "mips32r2"; abi = "o32"; }; }; - gcc_mips32r6_o32 = { gcc = { arch = "mips32r6"; abi = "o32"; }; }; + gcc_mips32r2_o32 = { gcc = { arch = "mips32r2"; abi = "o32"; }; }; # No c compiler can be build for this ABI + gcc_mips32r6_o32 = { gcc = { arch = "mips32r6"; abi = "o32"; }; }; # No c compiler can be build for this ABI gcc_mips64r2_n32 = { gcc = { arch = "mips64r2"; abi = "n32"; }; }; gcc_mips64r6_n32 = { gcc = { arch = "mips64r6"; abi = "n32"; }; }; gcc_mips64r2_64 = { gcc = { arch = "mips64r2"; abi = "64"; }; };