From 1eca8366e8d0728636d36c6da15d706acdc50bd3 Mon Sep 17 00:00:00 2001 From: Vincent Weisner Date: Wed, 20 Feb 2019 14:27:47 -0500 Subject: alpha-embedded: isAlpha code Added (#56090) Adds isAlpha to stdenv. flags. --- lib/systems/inspect.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/systems') diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index e35e7b4a1ec7..932f8fd1e536 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -21,6 +21,7 @@ rec { isSparc = { cpu = { family = "sparc"; }; }; isWasm = { cpu = { family = "wasm"; }; }; isAvr = { cpu = { family = "avr"; }; }; + isAlpha = { cpu = { family = "alpha"; }; }; is32bit = { cpu = { bits = 32; }; }; is64bit = { cpu = { bits = 64; }; }; -- cgit v1.2.3 From f455a07f13934285931c8bfc97fe10a3f0f3430d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 21 Feb 2019 22:17:51 -0500 Subject: systems: add isCompatible handling --- lib/systems/default.nix | 5 +++-- lib/systems/parse.nix | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 77f200952958..b24eb4245ff8 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -24,6 +24,8 @@ rec { config = parse.tripleFromSystem final.parsed; # Just a guess, based on `system` platform = platforms.selectBySystem final.system; + # Determine whether we are compatible with the provided CPU + isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu; # Derived meta-data libc = /**/ if final.isDarwin then "libSystem" @@ -98,8 +100,7 @@ rec { wine = (pkgs.winePackagesFor wine-name).minimal; in if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name && - (final.parsed.cpu.name == pkgs.stdenv.hostPlatform.parsed.cpu.name || - (final.isi686 && pkgs.stdenv.hostPlatform.isx86_64)) + pkgs.stdenv.hostPlatform.isCompatible final then pkgs.runtimeShell else if final.isWindows then "${wine}/bin/${wine-name}" diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 6947d41419e3..fab50bc0ebd7 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -112,6 +112,66 @@ rec { avr = { bits = 8; family = "avr"; }; }; + # Determine where two CPUs are compatible with each other. That is, + # can we run code built for system b on system a? For that to + # happen, then the set of all possible possible programs that system + # b accepts must be a subset of the set of all programs that system + # a accepts. This compatibility relation forms a category where each + # CPU is an object and each arrow from a to b represents + # compatibility. CPUs with multiple modes of Endianness are + # isomorphic while all CPUs are endomorphic because any program + # built for a CPU can run on that CPU. + isCompatible = a: b: with cpuTypes; lib.any lib.id [ + # x86 + (b == i386 && isCompatible a i486) + (b == i486 && isCompatible a i586) + (b == i586 && isCompatible a i686) + # NOTE: Not true in some cases. Like in WSL mode. + (b == i686 && isCompatible a x86_64) + + # ARM + (b == arm && isCompatible a armv5tel) + (b == armv5tel && isCompatible a armv6m) + (b == armv6m && isCompatible a armv6l) + (b == armv6l && isCompatible a armv7a) + (b == armv7a && isCompatible a armv7r) + (b == armv7r && isCompatible a armv7m) + (b == armv7m && isCompatible a armv7l) + (b == armv7l && isCompatible a armv8a) + (b == armv8a && isCompatible a armv8r) + (b == armv8r && isCompatible a armv8m) + # NOTE: not always true! Some arm64 cpus don’t support arm32 mode. + (b == armv8m && isCompatible a aarch64) + (b == aarch64 && a == aarch64_be) + (b == aarch64_be && isCompatible a aarch64) + + # PowerPC + (b == powerpc && isCompatible a powerpc64) + (b == powerpcle && isCompatible a powerpc) + (b == powerpc && a == powerpcle) + (b == powerpc64le && isCompatible a powerpc64) + (b == powerpc64 && a == powerpc64le) + + # MIPS + (b == mips && isCompatible a mips64) + (b == mips && a == mipsel) + (b == mipsel && isCompatible a mips) + (b == mips64 && a == mips64el) + (b == mips64el && isCompatible a mips64) + + # RISCV + (b == riscv32 && isCompatible a riscv64) + + # SPARC + (b == sparc && isCompatible a sparc64) + + # WASM + (b == wasm32 && isCompatible a wasm64) + + # identity + (b == a) + ]; + ################################################################################ types.openVendor = mkOptionType { -- cgit v1.2.3 From bfb45e96b946b85690d270df6a187d1ad4b39f7d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 21 Feb 2019 21:02:59 -0500 Subject: mesa: armv7a-linux supports mesa --- lib/systems/doubles.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 58677c0bdd90..2cf06b6ac1c8 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -47,5 +47,5 @@ in rec { unix = filterDoubles predicates.isUnix; windows = filterDoubles predicates.isWindows; - mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "powerpc64le-linux"]; + mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "armv7a-linux" "aarch64-linux" "powerpc64le-linux"]; } -- cgit v1.2.3 From 20a4bbe23b3039f26f739b026f90e4613a20a98c Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 25 Feb 2019 20:06:41 -0500 Subject: =?UTF-8?q?systems:=20add=20=E2=80=9Cemultator=E2=80=9D=20for=20wa?= =?UTF-8?q?sm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v8 can run any wasm bytecode --- lib/systems/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index b24eb4245ff8..e4629fc9bf80 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -106,6 +106,8 @@ rec { then "${wine}/bin/${wine-name}" else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux then "${qemu-user}/bin/qemu-${final.qemuArch}" + else if final.isWasm + then "${pkgs.v8}/bin/d8" else throw "Don't know how to run ${final.config} executables."; } // mapAttrs (n: v: v final.parsed) inspect.predicates -- cgit v1.2.3 From aab8c7ba437d240bd9780e09489e7358fee180e2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 28 Jul 2018 12:29:02 -0400 Subject: netbsd: add cross target --- lib/systems/default.nix | 1 + lib/systems/examples.nix | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 77f200952958..6e83546ae8e7 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -33,6 +33,7 @@ rec { else if final.isAndroid then "bionic" else if final.isLinux /* default */ then "glibc" else if final.isAvr then "avrlibc" + else if final.isNetBSD then "nblibc" # TODO(@Ericson2314) think more about other operating systems else "native/impure"; extensions = { diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index ac1633a1a15f..0c9a3b4a63f5 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -212,4 +212,11 @@ rec { libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain platform = {}; }; + + # BSDs + + amd64-netbsd = { + config = "x86_64-unknown-netbsd"; + libc = "nblibc"; + }; } -- cgit v1.2.3 From 8e25da0beb7d5c1af2d8de053044ab7b2588a0bd Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 25 Feb 2019 22:54:40 -0500 Subject: cross/tests: add llvm-based tests --- lib/systems/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index e4629fc9bf80..b3f7363fe612 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -101,7 +101,7 @@ rec { in if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name && pkgs.stdenv.hostPlatform.isCompatible final - then pkgs.runtimeShell + then "${pkgs.runtimeShell} -c" else if final.isWindows then "${wine}/bin/${wine-name}" else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux -- cgit v1.2.3 From 1eca945e948f89cf8baf0bfc6f91c303985fefbf Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Mon, 25 Mar 2019 19:17:37 -0700 Subject: systems: support TI MSP430 microcontrollers --- lib/systems/examples.nix | 5 +++++ lib/systems/inspect.nix | 1 + lib/systems/parse.nix | 1 + 3 files changed, 7 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index ac1633a1a15f..27a32181df88 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -102,6 +102,11 @@ rec { riscv64 = riscv "64"; riscv32 = riscv "32"; + msp430 = { + config = "msp430-elf"; + libc = "newlib"; + }; + avr = { config = "avr"; }; diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 932f8fd1e536..f8d5ca84d7aa 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -20,6 +20,7 @@ rec { isRiscV = { cpu = { family = "riscv"; }; }; isSparc = { cpu = { family = "sparc"; }; }; isWasm = { cpu = { family = "wasm"; }; }; + isMsp430 = { cpu = { family = "msp430"; }; }; isAvr = { cpu = { family = "avr"; }; }; isAlpha = { cpu = { family = "alpha"; }; }; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index fab50bc0ebd7..8cc7d3ae271f 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -109,6 +109,7 @@ rec { alpha = { bits = 64; significantByte = littleEndian; family = "alpha"; }; + msp430 = { bits = 16; significantByte = littleEndian; family = "msp430"; }; avr = { bits = 8; family = "avr"; }; }; -- cgit v1.2.3 From 1c7bb464d99301e42cbb0fe438c927c1440800c6 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Mon, 25 Mar 2019 20:33:39 -0700 Subject: msp430: include vendor headers with stdenv --- lib/systems/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index b3f7363fe612..9c6b51400dcb 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -34,6 +34,7 @@ rec { else if final.isUClibc then "uclibc" else if final.isAndroid then "bionic" else if final.isLinux /* default */ then "glibc" + else if final.isMsp430 then "newlib" else if final.isAvr then "avrlibc" # TODO(@Ericson2314) think more about other operating systems else "native/impure"; -- cgit v1.2.3 From 589c2c2870340c21b799795f6ed3b09608676499 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 10 Apr 2019 01:23:02 -0400 Subject: androidndk: fixup mess MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New android ndk (18) now uses clang. We were going through the wrapper that are provided. This lead to surprising errors when building. Ideally we could use the llvm linker as well, but this leads to errors as many packages don’t support the llvm linker. --- lib/systems/examples.nix | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 28a8d3cb9eb9..3e90c5ec2273 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -44,14 +44,6 @@ rec { platform = platforms.aarch64-multiplatform; }; - armv5te-android-prebuilt = rec { - config = "armv5tel-unknown-linux-androideabi"; - sdkVer = "21"; - ndkVer = "18b"; - platform = platforms.armv5te-android; - useAndroidPrebuilt = true; - }; - armv7a-android-prebuilt = rec { config = "armv7a-unknown-linux-androideabi"; sdkVer = "24"; -- cgit v1.2.3 From ac491d2df7365b304b96a1f3606ae8ba1522ed7d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 10 Apr 2019 01:31:04 -0400 Subject: systems: remove android armv5te platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this isn’t useful any more because the ndk we use no longer supports it. --- lib/systems/platforms.nix | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 03bfce256103..92de30162666 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -253,16 +253,6 @@ rec { kernelTarget = "zImage"; }; - # https://developer.android.com/ndk/guides/abis#armeabi - armv5te-android = { - name = "armeabi"; - gcc = { - arch = "armv5te"; - float = "soft"; - float-abi = "soft"; - }; - }; - # https://developer.android.com/ndk/guides/abis#v7a armv7a-android = { name = "armeabi-v7a"; -- cgit v1.2.3 From ec7643047c2ea1595a18ce6436ff6bebf057ac10 Mon Sep 17 00:00:00 2001 From: Ken Micklas Date: Tue, 16 Apr 2019 16:21:51 -0400 Subject: androidndk-pkgs: Remove -mfloat flag --- lib/systems/platforms.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 92de30162666..a2b43c970a41 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -258,7 +258,6 @@ rec { name = "armeabi-v7a"; gcc = { arch = "armv7-a"; - float = "hard"; float-abi = "softfp"; fpu = "vfpv3-d16"; }; -- cgit v1.2.3 From 59bb1dcbfb81fee9b727200ffc064cc6b2f05d59 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 10 Apr 2019 17:16:48 -0400 Subject: systems/parse.nix: fixup arm compatibilities --- lib/systems/parse.nix | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 8cc7d3ae271f..3e23a721f0d9 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -127,22 +127,42 @@ rec { (b == i386 && isCompatible a i486) (b == i486 && isCompatible a i586) (b == i586 && isCompatible a i686) - # NOTE: Not true in some cases. Like in WSL mode. + + # XXX: Not true in some cases. Like in WSL mode. (b == i686 && isCompatible a x86_64) - # ARM + # ARMv4 (b == arm && isCompatible a armv5tel) - (b == armv5tel && isCompatible a armv6m) - (b == armv6m && isCompatible a armv6l) - (b == armv6l && isCompatible a armv7a) - (b == armv7a && isCompatible a armv7r) - (b == armv7r && isCompatible a armv7m) - (b == armv7m && isCompatible a armv7l) - (b == armv7l && isCompatible a armv8a) - (b == armv8a && isCompatible a armv8r) - (b == armv8r && isCompatible a armv8m) - # NOTE: not always true! Some arm64 cpus don’t support arm32 mode. - (b == armv8m && isCompatible a aarch64) + + # ARMv5 + (b == armv5tel && isCompatible a armv6l) + + # ARMv6 + (b == armv6l && isCompatible a armv6m) + (b == armv6m && isCompatible a armv7l) + + # ARMv7 + (b == armv7l && isCompatible a armv7a) + (b == armv7l && isCompatible a armv7r) + (b == armv7l && isCompatible a armv7m) + (b == armv7a && isCompatible a armv8a) + (b == armv7r && isCompatible a armv8a) + (b == armv7m && isCompatible a armv8a) + (b == armv7a && isCompatible a armv8r) + (b == armv7r && isCompatible a armv8r) + (b == armv7m && isCompatible a armv8r) + (b == armv7a && isCompatible a armv8m) + (b == armv7r && isCompatible a armv8m) + (b == armv7m && isCompatible a armv8m) + + # ARMv8 + (b == armv8r && isCompatible a armv8a) + (b == armv8m && isCompatible a armv8a) + + # XXX: not always true! Some arm64 cpus don’t support arm32 mode. + (b == aarch64 && a == armv8a) + (b == armv8a && isCompatible a aarch64) + (b == aarch64 && a == aarch64_be) (b == aarch64_be && isCompatible a aarch64) -- cgit v1.2.3 From 23560ea057024811dfeea8be0b7bd9b7a3d63b31 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 17 Apr 2019 16:41:33 -0400 Subject: systems: fix emulator identity Squashed to fix shell quoting, thanks @Ericson2314 --- lib/systems/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 52b9bd46e600..dd4f85c17cb4 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -103,7 +103,7 @@ rec { in if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name && pkgs.stdenv.hostPlatform.isCompatible final - then "${pkgs.runtimeShell} -c" + then "${pkgs.runtimeShell} -c '\"$@\"' --" else if final.isWindows then "${wine}/bin/${wine-name}" else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux -- cgit v1.2.3 From 5eea6587786edc63f9442f9c32703e62ba1729bb Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 17 Apr 2019 13:09:34 -0400 Subject: systems: correct qemu architectures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ppc64le and ppc64 are different targets in the configure script. We can’t use the same one. TODO: canonicalize similar ones based on qemu’s configure script. --- lib/systems/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index dd4f85c17cb4..8eeab67f7f33 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -78,10 +78,9 @@ rec { else if final.isx86 then "i386" else { "powerpc" = "ppc"; + "powerpcle" = "ppc"; "powerpc64" = "ppc64"; - "powerpc64le" = "ppc64"; - "mips64" = "mips"; - "mipsel64" = "mipsel"; + "powerpc64le" = "ppc64le"; }.${final.parsed.cpu.name} or final.parsed.cpu.name; emulator = pkgs: let -- cgit v1.2.3 From d8934feba1399d220550b81dceeb6da35149cf02 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 19 Apr 2019 14:51:25 -0400 Subject: kernel-headers: infer ARCH from config triple This makes us less reliant on the systems/examples.nix. You should be able to cross compile with just your triple: $ nix build --arg crossSystem '{ config = "armv6l-unknown-linux-gnueabi"; }' stdenv --- lib/systems/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 8eeab67f7f33..b45a5fd8d2ba 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -72,6 +72,13 @@ rec { release = null; }; + kernelArch = + if final.isAarch32 then "arm" + else if final.isAarch64 then "arm64" + else if final.isx86_32 then "x86" + else if final.isx86_64 then "ia64" + else final.parsed.cpu.name; + qemuArch = if final.isArm then "arm" else if final.isx86_64 then "x86_64" -- cgit v1.2.3 From ae50241871c7d8816eaccdeac0c7bf6d4a5394bd Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 20 Apr 2019 17:21:51 -0400 Subject: release-cross: remove alpha-elf target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This doesn’t appear to ever have worked. binutils doesn’t seem to support the alpha-elf target at all. It doesn’t make sense to keep this around. https://hydra.nixos.org/build/92403855/nixlog/1/tail --- lib/systems/examples.nix | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 3e90c5ec2273..1a5b80449bf2 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -131,11 +131,6 @@ rec { config = "powerpcle-none-eabi"; libc = "newlib"; }; - - alpha-embedded = { - config = "alpha-elf"; - libc = "newlib"; - }; i686-embedded = { config = "i686-elf"; -- cgit v1.2.3 From d180cb98503d2dc1e51d8c14b4a567e1ed3e996d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 9 Apr 2019 14:21:54 -0400 Subject: cc-wrapper: make machine configuration configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is useful to make these dynamic and not bake them into gcc. This means we don’t have to rebuild gcc to change these values. Instead, we will pass cflags to gcc based on platform values. This was already done hackily for android gcc (which is multi-target), but not for our own gccs which are single target. To accomplish this, we need to add a few things: - add ‘arch’ to cpu - add NIX_CFLAGS_COMPILE_BEFORE flag (goes before args) - set -march everywhere - set mcpu, mfpu, mmode, and mtune based on targetPlatform.gcc flags cc-wrapper: only set -march when it is in the cpu type Some architectures don’t have a good mapping of -march. For instance POWER architecture doesn’t support the -march flag at all! https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options --- lib/systems/parse.nix | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 3e23a721f0d9..cd0a11c058e6 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -69,24 +69,24 @@ rec { cpuTypes = with significantBytes; setTypes types.openCpuType { arm = { bits = 32; significantByte = littleEndian; family = "arm"; }; - armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; version = "5"; }; - armv6m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; }; - armv6l = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; }; - armv7a = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; }; - armv7r = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; }; - armv7m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; }; - armv7l = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; }; - armv8a = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; }; - armv8r = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; }; - armv8m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; }; - aarch64 = { bits = 64; significantByte = littleEndian; family = "arm"; version = "8"; }; - aarch64_be = { bits = 64; significantByte = bigEndian; family = "arm"; version = "8"; }; - - i386 = { bits = 32; significantByte = littleEndian; family = "x86"; }; - i486 = { bits = 32; significantByte = littleEndian; family = "x86"; }; - i586 = { bits = 32; significantByte = littleEndian; family = "x86"; }; - i686 = { bits = 32; significantByte = littleEndian; family = "x86"; }; - x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; }; + armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; version = "5"; arch = "armv5t"; }; + armv6m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; arch = "armv6-m"; }; + armv6l = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; arch = "armv6"; }; + armv7a = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; arch = "armv7-a"; }; + armv7r = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; arch = "armv7-r"; }; + armv7m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; arch = "armv7-m"; }; + armv7l = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; arch = "armv7"; }; + armv8a = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; arch = "armv8-a"; }; + armv8r = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; arch = "armv8-a"; }; + armv8m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; arch = "armv8-m"; }; + aarch64 = { bits = 64; significantByte = littleEndian; family = "arm"; version = "8"; arch = "armv8-a"; }; + aarch64_be = { bits = 64; significantByte = bigEndian; family = "arm"; version = "8"; arch = "armv8-a"; }; + + i386 = { bits = 32; significantByte = littleEndian; family = "x86"; arch = "i386"; }; + i486 = { bits = 32; significantByte = littleEndian; family = "x86"; arch = "i486"; }; + i586 = { bits = 32; significantByte = littleEndian; family = "x86"; arch = "i586"; }; + i686 = { bits = 32; significantByte = littleEndian; family = "x86"; arch = "i686"; }; + x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; arch = "x86-64"; }; mips = { bits = 32; significantByte = bigEndian; family = "mips"; }; mipsel = { bits = 32; significantByte = littleEndian; family = "mips"; }; -- cgit v1.2.3 From 9abff4af4f07c16aecd89bf82051afbc3228d6fd Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 29 Jan 2019 21:01:24 -0500 Subject: wasm: init cross target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds pkgsCross.wasm32 and pkgsCross.wasm64. Use it to build Nixpkgs with a WebAssembly toolchain. stdenv/cross: use static overlay on isWasm isWasm doesn’t make sense dynamically linked. --- lib/systems/default.nix | 3 ++- lib/systems/doubles.nix | 3 +++ lib/systems/examples.nix | 14 ++++++++++++-- lib/systems/for-meta.nix | 1 + lib/systems/inspect.nix | 3 ++- lib/systems/parse.nix | 4 ++++ 6 files changed, 24 insertions(+), 4 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index b45a5fd8d2ba..c408fe46be6f 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -30,6 +30,7 @@ rec { libc = /**/ if final.isDarwin then "libSystem" else if final.isMinGW then "msvcrt" + else if final.isWasi then "wasilibc" else if final.isMusl then "musl" else if final.isUClibc then "uclibc" else if final.isAndroid then "bionic" @@ -62,7 +63,7 @@ rec { "netbsd" = "NetBSD"; "freebsd" = "FreeBSD"; "openbsd" = "OpenBSD"; - "wasm" = "Wasm"; + "wasi" = "Wasi"; }.${final.parsed.kernel.name} or null; # uname -p diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 2cf06b6ac1c8..c6877ebef0bc 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -17,6 +17,8 @@ let "x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris" "x86_64-windows" "i686-windows" + + "wasm64-wasi" "wasm32-wasi" ]; allParsed = map parse.mkSystemFromString all; @@ -45,6 +47,7 @@ in rec { netbsd = filterDoubles predicates.isNetBSD; openbsd = filterDoubles predicates.isOpenBSD; unix = filterDoubles predicates.isUnix; + wasi = filterDoubles predicates.isWasi; windows = filterDoubles predicates.isWindows; mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "armv7a-linux" "aarch64-linux" "powerpc64le-linux"]; diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 1a5b80449bf2..94c7cfd7570f 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -116,7 +116,7 @@ rec { config = "aarch64-none-elf"; libc = "newlib"; }; - + aarch64be-embedded = { config = "aarch64_be-none-elf"; libc = "newlib"; @@ -126,7 +126,7 @@ rec { config = "powerpc-none-eabi"; libc = "newlib"; }; - + ppcle-embedded = { config = "powerpcle-none-eabi"; libc = "newlib"; @@ -211,4 +211,14 @@ rec { config = "x86_64-unknown-netbsd"; libc = "nblibc"; }; + + # + # WASM + # + + wasi32 = { + config = "wasm32-unknown-wasi"; + useLLVM = true; + }; + } diff --git a/lib/systems/for-meta.nix b/lib/systems/for-meta.nix index 51fb6ae760d1..17ae94deb7d1 100644 --- a/lib/systems/for-meta.nix +++ b/lib/systems/for-meta.nix @@ -32,6 +32,7 @@ in rec { openbsd = [ patterns.isOpenBSD ]; unix = patterns.isUnix; # Actually a list windows = [ patterns.isWindows ]; + wasi = [ patterns.isWasi ]; inherit (lib.systems.doubles) mesaPlatforms; } diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index f8d5ca84d7aa..b88af55e46be 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -43,9 +43,10 @@ rec { isWindows = { kernel = kernels.windows; }; isCygwin = { kernel = kernels.windows; abi = abis.cygnus; }; isMinGW = { kernel = kernels.windows; abi = abis.gnu; }; + isWasi = { kernel = kernels.wasi; }; isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ]; - isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]; + isMusl = (with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]) ++ [{ kernel = kernels.wasi; }]; isUClibc = with abis; map (a: { abi = a; }) [ uclibc uclibceabi uclibceabihf ]; isEfi = map (family: { cpu.family = family; }) diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 3e23a721f0d9..522a3bf71aff 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -226,6 +226,7 @@ rec { elf = {}; macho = {}; pe = {}; + wasm = {}; unknown = {}; }; @@ -268,6 +269,7 @@ rec { none = { execFormat = unknown; families = { }; }; openbsd = { execFormat = elf; families = { inherit bsd; }; }; solaris = { execFormat = elf; families = { }; }; + wasi = { execFormat = wasm; families = { }; }; windows = { execFormat = pe; families = { }; }; } // { # aliases # 'darwin' is the kernel for all of them. We choose macOS by default. @@ -376,6 +378,8 @@ rec { then { cpu = elemAt l 0; kernel = elemAt l 1; abi = elemAt l 2; } else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; } + else if (elemAt l 2 == "wasi") + then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "wasi"; } else if hasPrefix "netbsd" (elemAt l 2) then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; } else if (elem (elemAt l 2) ["eabi" "eabihf" "elf"]) -- cgit v1.2.3 From d591a109beee6512ea45e03e83901d269c8ec39b Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 15 Apr 2019 21:10:42 -0400 Subject: =?UTF-8?q?wasm:=20don=E2=80=99t=20assume=20musl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/systems/inspect.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index b88af55e46be..1c90af88879a 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -46,7 +46,7 @@ rec { isWasi = { kernel = kernels.wasi; }; isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ]; - isMusl = (with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]) ++ [{ kernel = kernels.wasi; }]; + isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]; isUClibc = with abis; map (a: { abi = a; }) [ uclibc uclibceabi uclibceabihf ]; isEfi = map (family: { cpu.family = family; }) -- cgit v1.2.3 From dbb94b984f8282d1d9eada83634fc6777d19bdac Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 15 Apr 2019 22:22:16 -0400 Subject: wasmtime: init and use for emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This isn’t really an "emulator" but it’s the closest concept we have right now. --- lib/systems/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index c408fe46be6f..5e6d277be7d5 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -115,8 +115,8 @@ rec { then "${wine}/bin/${wine-name}" else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux then "${qemu-user}/bin/qemu-${final.qemuArch}" - else if final.isWasm - then "${pkgs.v8}/bin/d8" + else if final.isWasi + then "${pkgs.wasmtime}/bin/wasmtime" else throw "Don't know how to run ${final.config} executables."; } // mapAttrs (n: v: v final.parsed) inspect.predicates -- cgit v1.2.3 From e500bb84090ddca3e213f4d6ced1f1647be486d6 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 30 Apr 2019 11:50:45 -0400 Subject: systems: add riscv double This was never listed in doubles.nix! Not sure why? --- lib/systems/doubles.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index c6877ebef0bc..ff071c182d4f 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -19,6 +19,8 @@ let "x86_64-windows" "i686-windows" "wasm64-wasi" "wasm32-wasi" + + "riscv32-linux" "riscv64-linux" ]; allParsed = map parse.mkSystemFromString all; @@ -36,6 +38,7 @@ in rec { i686 = filterDoubles predicates.isi686; x86_64 = filterDoubles predicates.isx86_64; mips = filterDoubles predicates.isMips; + riscv = filterDoubles predicates.isRiscV; cygwin = filterDoubles predicates.isCygwin; darwin = filterDoubles predicates.isDarwin; -- cgit v1.2.3 From fb147b07add8186f4417b0cf64e276e444f4d6bb Mon Sep 17 00:00:00 2001 From: Lionello Lunesu Date: Sun, 5 May 2019 15:23:12 +0800 Subject: Adds pkgsCross.gnu32 and pkgsCross.gnu64 platforms --- lib/systems/examples.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 94c7cfd7570f..d17af9fcc148 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -88,6 +88,9 @@ rec { config = "aarch64-unknown-linux-musl"; }; + gnu64 = { config = "x86_64-unknown-linux-gnu"; }; + gnu32 = { config = "i686-unknown-linux-gnu"; }; + musl64 = { config = "x86_64-unknown-linux-musl"; }; musl32 = { config = "i686-unknown-linux-musl"; }; -- cgit v1.2.3 From 40271ae1382b14673b7b3f9edb6c1f9bba1bbe47 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Jun 2019 11:09:43 -0400 Subject: systems: remove forMeta This is unused now. --- lib/systems/default.nix | 1 - lib/systems/for-meta.nix | 38 -------------------------------------- 2 files changed, 39 deletions(-) delete mode 100644 lib/systems/for-meta.nix (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 5e6d277be7d5..ea18904cc635 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -3,7 +3,6 @@ rec { doubles = import ./doubles.nix { inherit lib; }; - forMeta = import ./for-meta.nix { inherit lib; }; parse = import ./parse.nix { inherit lib; }; inspect = import ./inspect.nix { inherit lib; }; platforms = import ./platforms.nix { inherit lib; }; diff --git a/lib/systems/for-meta.nix b/lib/systems/for-meta.nix deleted file mode 100644 index 17ae94deb7d1..000000000000 --- a/lib/systems/for-meta.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib }: -let - inherit (lib.systems) parse; - inherit (lib.systems.inspect) patterns; - - abis = lib.mapAttrs (_: abi: builtins.removeAttrs abi [ "assertions" ]) parse.abis; - -in rec { - all = [ {} ]; # `{}` matches anything - none = []; - - arm = [ patterns.isAarch32 ]; - aarch64 = [ patterns.isAarch64 ]; - x86 = [ patterns.isx86 ]; - i686 = [ patterns.isi686 ]; - x86_64 = [ patterns.isx86_64 ]; - mips = [ patterns.isMips ]; - riscv = [ patterns.isRiscV ]; - - cygwin = [ patterns.isCygwin ]; - darwin = [ patterns.isDarwin ]; - freebsd = [ patterns.isFreeBSD ]; - # Should be better, but MinGW is unclear. - gnu = [ - { kernel = parse.kernels.linux; abi = abis.gnu; } - { kernel = parse.kernels.linux; abi = abis.gnueabi; } - { kernel = parse.kernels.linux; abi = abis.gnueabihf; } - ]; - illumos = [ patterns.isSunOS ]; - linux = [ patterns.isLinux ]; - netbsd = [ patterns.isNetBSD ]; - openbsd = [ patterns.isOpenBSD ]; - unix = patterns.isUnix; # Actually a list - windows = [ patterns.isWindows ]; - wasi = [ patterns.isWasi ]; - - inherit (lib.systems.doubles) mesaPlatforms; -} -- cgit v1.2.3 From 635b7625690d9f8f61da0a187e7ed4a7ec274fdc Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Jun 2019 11:10:03 -0400 Subject: systems: allow passing in string for cross/localSystem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes things a little bit more convenient. Just pass in like: $ nix-build ’’ -A hello --argstr localSystem x86_64-linux --argstr crossSystem aarch64-linux --- lib/systems/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index ea18904cc635..8aa413f53817 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -14,7 +14,9 @@ rec { # `parsed` is inferred from args, both because there are two options with one # clearly prefered, and to prevent cycles. A simpler fixed point where the RHS # always just used `final.*` would fail on both counts. - elaborate = args: let + elaborate = args': let + args = if lib.isString args' then { system = args'; } + else args'; final = { # Prefer to parse `config` as it is strictly more informative. parsed = parse.mkSystemFromString (if args ? config then args.config else args.system); -- cgit v1.2.3 From f7c7207a3fb69a00faf6aad5a165e3c53c1c1c6c Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Jun 2019 13:34:40 -0400 Subject: systems: add missing doubles in https://github.com/NixOS/nixpkgs/pull/60349, the attr handling was removed. This means we rely on these double values for determing what we are compatible with. This adds some of the missing doubles to this list. https://hydra.nixos.org/eval/1523389#tabs-removed --- lib/systems/doubles.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index ff071c182d4f..68c5a1aa815e 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -20,7 +20,11 @@ let "wasm64-wasi" "wasm32-wasi" + "powerpc64le-linux" + "riscv32-linux" "riscv64-linux" + + "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "ppc-none" "msp430-none" ]; allParsed = map parse.mkSystemFromString all; -- cgit v1.2.3 From de70b767796bfa3545d5fa565022d47b65eab8bc Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Jun 2019 13:42:14 -0400 Subject: systems: fixup from last commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it’s powerpc-none not ppc-none --- lib/systems/doubles.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 68c5a1aa815e..f215090f06c1 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -24,7 +24,7 @@ let "riscv32-linux" "riscv64-linux" - "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "ppc-none" "msp430-none" + "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" ]; allParsed = map parse.mkSystemFromString all; -- cgit v1.2.3 From 0fef9f89e4cedfa87d44b814629a9b94af8667a9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Jun 2019 14:49:58 -0400 Subject: systems: fix lib-tests These were broken by the added system doubles. This just adds those to the lib-tests. --- lib/systems/doubles.nix | 2 ++ lib/systems/inspect.nix | 1 + 2 files changed, 3 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index f215090f06c1..09e9089aa6fd 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -57,5 +57,7 @@ in rec { wasi = filterDoubles predicates.isWasi; windows = filterDoubles predicates.isWindows; + embedded = filterDoubles predicates.isNone; + mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "armv7a-linux" "aarch64-linux" "powerpc64le-linux"]; } diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 1c90af88879a..9a12e3c3926d 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -44,6 +44,7 @@ rec { isCygwin = { kernel = kernels.windows; abi = abis.cygnus; }; isMinGW = { kernel = kernels.windows; abi = abis.gnu; }; isWasi = { kernel = kernels.wasi; }; + isNone = { kernel = kernels.none; }; isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ]; isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]; -- cgit v1.2.3 From f3282c8d1e0ce6ba5d9f6aeddcfad51d879c7a4a Mon Sep 17 00:00:00 2001 From: volth Date: Sun, 16 Jun 2019 19:59:06 +0000 Subject: treewide: remove unused variables (#63177) * treewide: remove unused variables * making ofborg happy --- lib/systems/parse.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 7f5912a13a75..b088cd342f12 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -428,7 +428,7 @@ rec { mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s)); - doubleFromSystem = { cpu, vendor, kernel, abi, ... }: + doubleFromSystem = { cpu, kernel, abi, ... }: /**/ if abi == abis.cygnus then "${cpu.name}-cygwin" else if kernel.families ? darwin then "${cpu.name}-darwin" else "${cpu.name}-${kernel.name}"; -- cgit v1.2.3 From 00ba557856d6217121e50ea69c251e9458d9dc08 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 8 Jul 2019 12:31:11 -0400 Subject: systems/doubles.nix: add Apple doubles These are used in cross-compilation to iOS devices and simulators. Fallout from #60349. --- lib/systems/doubles.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 09e9089aa6fd..39018d045b32 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -13,9 +13,11 @@ let "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd" - "x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-linux" + "x86_64-cygwin" "x86_64-freebsd" "x86_64-linux" "x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris" + "x86_64-darwin" "aarch64-ios" "armv7a-ios" "x86_64-ios" "i686-ios" + "x86_64-windows" "i686-windows" "wasm64-wasi" "wasm32-wasi" -- cgit v1.2.3 From ce2f74df2cade57e74c235292c8b074281903e71 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 10 Jul 2019 12:35:48 +0200 Subject: Revert "systems/doubles.nix: add Apple doubles" The lib tests need to be fixed as well. This unbreaks the tarball job. This reverts commit 00ba557856d6217121e50ea69c251e9458d9dc08. --- lib/systems/doubles.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 39018d045b32..09e9089aa6fd 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -13,11 +13,9 @@ let "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd" - "x86_64-cygwin" "x86_64-freebsd" "x86_64-linux" + "x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-linux" "x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris" - "x86_64-darwin" "aarch64-ios" "armv7a-ios" "x86_64-ios" "i686-ios" - "x86_64-windows" "i686-windows" "wasm64-wasi" "wasm32-wasi" -- cgit v1.2.3 From d059185badb3203d35eee0f70c48b85bf278fb57 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 10 Jul 2019 14:38:55 -0400 Subject: Revert "Revert "systems/doubles.nix: add Apple doubles"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ce2f74df2cade57e74c235292c8b074281903e71. Doubles are treated as -darwin here, to provide some consistency. There is some ambiguity between “x86_64-darwin” and “i686-darwin” which could refer to binaries linked between iOS simulator or real macOS binaries. useiOSPrebuilt can be used to determine which to use, however. --- lib/systems/doubles.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 09e9089aa6fd..f096a0b17fc6 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -13,9 +13,11 @@ let "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd" - "x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-linux" + "x86_64-cygwin" "x86_64-freebsd" "x86_64-linux" "x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris" + "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" + "x86_64-windows" "i686-windows" "wasm64-wasi" "wasm32-wasi" -- cgit v1.2.3 From e931a525f974c5b038889b5cae3c1b07e9bc6663 Mon Sep 17 00:00:00 2001 From: Jay Kruer Date: Thu, 25 Jul 2019 16:31:35 -0700 Subject: Add RISC-V embedded crossSystems --- lib/systems/doubles.nix | 2 +- lib/systems/examples.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index f096a0b17fc6..823f6a915d6e 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -26,7 +26,7 @@ let "riscv32-linux" "riscv64-linux" - "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" + "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" ]; allParsed = map parse.mkSystemFromString all; diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index d17af9fcc148..aa55438de082 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -97,6 +97,18 @@ rec { riscv64 = riscv "64"; riscv32 = riscv "32"; + riscv64-embedded = { + config = "riscv64-none-elf"; + libc = "newlib"; + platform = platforms.riscv-multiplatform "64"; + }; + + riscv32-embedded = { + config = "riscv32-none-elf"; + libc = "newlib"; + platform = platforms.riscv-multiplatform "32"; + }; + msp430 = { config = "msp430-elf"; libc = "newlib"; -- cgit v1.2.3