diff options
author | Sergei Trofimovich <slyich@gmail.com> | 2021-09-07 10:10:38 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-09-09 10:58:47 +0000 |
commit | 34e468dc4268cee86aa019ae9bc52768e60fb5f7 (patch) | |
tree | f199da6591d3ab885e0185ee0c018b5412fa61cc | |
parent | 3e788570514ec7098f2e7fd00edc673fc89b3a21 (diff) | |
download | nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.tar nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.tar.gz nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.tar.bz2 nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.tar.lz nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.tar.xz nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.tar.zst nixpkgs-34e468dc4268cee86aa019ae9bc52768e60fb5f7.zip |
lib/systems: add minimal s390x-linux cross-compile support
Tested basic functionality as: $ nix-build --arg crossSystem '{ config = "s390x-unknown-linux-gnu"; }' -A re2c $ file ./result/bin/re2c $ ./result/bin/re2c: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), dynamically linked, interpreter ...-gnu-2.33-50/lib/ld64.so.1, for GNU/Linux 2.6.32, not stripped $ qemu-s390x ./result/bin/re2c --version re2c 2.2
-rw-r--r-- | lib/systems/default.nix | 1 | ||||
-rw-r--r-- | lib/systems/doubles.nix | 5 | ||||
-rw-r--r-- | lib/systems/examples.nix | 4 | ||||
-rw-r--r-- | lib/systems/parse.nix | 1 | ||||
-rw-r--r-- | lib/tests/systems.nix | 2 |
5 files changed, 10 insertions, 3 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 70ec98b03c1..ef609859abb 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -107,6 +107,7 @@ rec { else if final.isMips then "mips" else if final.isPower then "powerpc" else if final.isRiscV then "riscv" + else if final.isS390 then "s390" else final.parsed.cpu.name; qemuArch = diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index e577059687b..8af3377fb5b 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -28,7 +28,7 @@ let "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "m68k-linux" "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" - "riscv64-linux" "s390-linux" "x86_64-linux" + "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux" # MMIXware "mmix-mmixware" @@ -41,7 +41,8 @@ let # none "aarch64-none" "arm-none" "armv6l-none" "avr-none" "i686-none" "msp430-none" "or1k-none" "m68k-none" "powerpc-none" - "riscv32-none" "riscv64-none" "s390-none" "vc4-none" "x86_64-none" + "riscv32-none" "riscv64-none" "s390-none" "s390x-none" "vc4-none" + "x86_64-none" # OpenBSD "i686-openbsd" "x86_64-openbsd" diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 32b236d6960..8dfa22ac787 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -152,6 +152,10 @@ rec { config = "s390-unknown-linux-gnu"; }; + s390x = { + config = "s390x-unknown-linux-gnu"; + }; + arm-embedded = { config = "arm-none-eabi"; libc = "newlib"; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 77e941a913c..8a88d8cfbe8 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -106,6 +106,7 @@ rec { riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; }; s390 = { bits = 32; significantByte = bigEndian; family = "s390"; }; + s390x = { bits = 64; significantByte = bigEndian; family = "s390"; }; sparc = { bits = 32; significantByte = bigEndian; family = "sparc"; }; sparc64 = { bits = 64; significantByte = bigEndian; family = "sparc"; }; diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index 661b9bc8690..2646e792682 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -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" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" ]; + 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" "s390x-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" ]; |