summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-01 12:25:45 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-01 15:27:12 +0000
commit3669b12f35aa4cce673191e061349e70bb3d4ddd (patch)
treee3aa2d2fa9323cf283972b534eb1fe50ef38ad84 /lib
parent173a37e7b5bb79566ca91876820235a88acea03d (diff)
downloadnixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.tar
nixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.tar.gz
nixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.tar.bz2
nixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.tar.lz
nixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.tar.xz
nixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.tar.zst
nixpkgs-3669b12f35aa4cce673191e061349e70bb3d4ddd.zip
lib.systems: add m68k-netbsd support
m68k was recently added for Linux and none, but NetBSD also supports
m68k.  Nothing will build yet, but I want to make sure we at least
encode the existence of NetBSD support for every applicable
architecture we support for other operating systems.
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/doubles.nix4
-rw-r--r--lib/systems/parse.nix7
-rw-r--r--lib/tests/systems.nix2
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix
index 741839de3aa..e577059687b 100644
--- a/lib/systems/doubles.nix
+++ b/lib/systems/doubles.nix
@@ -35,8 +35,8 @@ let
 
     # NetBSD
     "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd"
-    "i686-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd"
-    "riscv64-netbsd" "x86_64-netbsd"
+    "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd"
+    "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd"
 
     # none
     "aarch64-none" "arm-none" "armv6l-none" "avr-none" "i686-none"
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 386f252f2ba..77e941a913c 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -127,9 +127,10 @@ rec {
 
   # GNU build systems assume that older NetBSD architectures are using a.out.
   gnuNetBSDDefaultExecFormat = cpu:
-    if (cpu.family == "x86" && cpu.bits == 32) ||
-       (cpu.family == "arm" && cpu.bits == 32) ||
-       (cpu.family == "sparc" && cpu.bits == 32)
+    if (cpu.family == "arm" && cpu.bits == 32) ||
+       (cpu.family == "sparc" && cpu.bits == 32) ||
+       (cpu.family == "m68k" && cpu.bits == 32) ||
+       (cpu.family == "x86" && cpu.bits == 32)
     then execFormats.aout
     else execFormats.elf;
 
diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix
index 6bd43f0d0d0..661b9bc8690 100644
--- a/lib/tests/systems.nix
+++ b/lib/tests/systems.nix
@@ -29,7 +29,7 @@ with lib.systems.doubles; lib.runTests {
   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" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" ];
-  testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ];
+  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" ];
   testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox);