From 60fd049b6552d73a5162109e7d8aa0839b54c398 Mon Sep 17 00:00:00 2001 From: Aaron Janse Date: Tue, 21 Jul 2020 13:11:36 -0700 Subject: redox: add as target --- lib/systems/default.nix | 2 ++ lib/systems/doubles.nix | 3 +++ lib/systems/examples.nix | 9 +++++++++ lib/systems/inspect.nix | 3 ++- lib/systems/parse.nix | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 210674cc6399..c929781dd8ff 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -32,6 +32,7 @@ rec { /**/ if final.isDarwin then "libSystem" else if final.isMinGW then "msvcrt" else if final.isWasi then "wasilibc" + else if final.isRedox then "relibc" else if final.isMusl then "musl" else if final.isUClibc then "uclibc" else if final.isAndroid then "bionic" @@ -65,6 +66,7 @@ rec { freebsd = "FreeBSD"; openbsd = "OpenBSD"; wasi = "Wasi"; + redox = "Redox"; genode = "Genode"; }.${final.parsed.kernel.name} or null; diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index a839b3d3d573..c0e78595d85d 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -22,6 +22,8 @@ let "wasm64-wasi" "wasm32-wasi" + "x86_64-redox" + "powerpc64le-linux" "riscv32-linux" "riscv64-linux" @@ -69,6 +71,7 @@ in { openbsd = filterDoubles predicates.isOpenBSD; unix = filterDoubles predicates.isUnix; wasi = filterDoubles predicates.isWasi; + redox = filterDoubles predicates.isRedox; windows = filterDoubles predicates.isWindows; genode = filterDoubles predicates.isGenode; diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 19b3790ecbe0..ca562d2e4565 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -163,6 +163,15 @@ rec { libc = "newlib"; }; + # + # Redox + # + + x86_64-unknown-redox = { + config = "x86_64-unknown-redox"; + libc = "relibc"; + }; + # # Darwin # diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 90a1fb6d80c2..8fa630572509 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -33,7 +33,7 @@ rec { isBSD = { kernel = { families = { inherit (kernelFamilies) bsd; }; }; }; isDarwin = { kernel = { families = { inherit (kernelFamilies) darwin; }; }; }; - isUnix = [ isBSD isDarwin isLinux isSunOS isCygwin ]; + isUnix = [ isBSD isDarwin isLinux isSunOS isCygwin isRedox ]; isMacOS = { kernel = kernels.macos; }; isiOS = { kernel = kernels.ios; }; @@ -46,6 +46,7 @@ rec { isCygwin = { kernel = kernels.windows; abi = abis.cygnus; }; isMinGW = { kernel = kernels.windows; abi = abis.gnu; }; isWasi = { kernel = kernels.wasi; }; + isRedox = { kernel = kernels.redox; }; isGhcjs = { kernel = kernels.ghcjs; }; isGenode = { kernel = kernels.genode; }; isNone = { kernel = kernels.none; }; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 648e7c270240..6bd44a007466 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -277,6 +277,7 @@ rec { openbsd = { execFormat = elf; families = { inherit bsd; }; }; solaris = { execFormat = elf; families = { }; }; wasi = { execFormat = wasm; families = { }; }; + redox = { execFormat = elf; families = { }; }; windows = { execFormat = pe; families = { }; }; ghcjs = { execFormat = unknown; families = { }; }; genode = { execFormat = elf; families = { }; }; @@ -390,6 +391,8 @@ rec { 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 (elemAt l 2 == "redox") + then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "redox"; } 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 ccedb29f4b0b3a02f28be0a06cae480da2be432b Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 4 Aug 2020 17:50:55 +0200 Subject: Define a i686-genode system double --- 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 c0e78595d85d..fb7d722e737e 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -38,7 +38,7 @@ let "js-ghcjs" - "aarch64-genode" "x86_64-genode" + "aarch64-genode" "i686-genode" "x86_64-genode" ]; allParsed = map parse.mkSystemFromString all; -- cgit v1.2.3 From cf7b63df5b9efdef4e8e1b3261d7040199f7e671 Mon Sep 17 00:00:00 2001 From: volth Date: Wed, 5 Aug 2020 02:32:41 +0000 Subject: gcc.arch: refactor, move tables under lib/ --- lib/systems/architectures.nix | 75 +++++++++++++++++++++++++++++++++++++++++++ lib/systems/default.nix | 2 ++ 2 files changed, 77 insertions(+) create mode 100644 lib/systems/architectures.nix (limited to 'lib/systems') diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix new file mode 100644 index 000000000000..287f5be03c45 --- /dev/null +++ b/lib/systems/architectures.nix @@ -0,0 +1,75 @@ +{ lib }: + +rec { + # platform.gcc.arch to its features (as in /proc/cpuinfo) + features = { + default = [ ]; + # x86_64 Intel + westmere = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" ]; + sandybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ]; + ivybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ]; + haswell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ]; + broadwell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ]; + skylake = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ]; + skylake-avx512 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "avx512" "fma" ]; + # x86_64 AMD + btver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" ]; + btver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ]; + bdver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ]; + bdver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ]; + bdver3 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ]; + bdver4 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" "fma4" ]; + znver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" ]; + znver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" ]; + # other + armv5te = [ ]; + armv6 = [ ]; + armv7-a = [ ]; + armv8-a = [ ]; + mips32 = [ ]; + loongson2f = [ ]; + }; + + # a superior CPU has all the features of an inferior and is able to build and test code for it + inferiors = { + # x86_64 Intel + default = [ ]; + westmere = [ ]; + sandybridge = [ "westmere" ]; + ivybridge = [ "westmere" "sandybridge" ]; + haswell = [ "westmere" "sandybridge" "ivybridge" ]; + broadwell = [ "westmere" "sandybridge" "ivybridge" "haswell" ]; + skylake = [ "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" ]; + skylake-avx512 = [ "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" ]; + # x86_64 AMD + btver1 = [ ]; + btver2 = [ ]; + bdver1 = [ ]; + bdver2 = [ ]; + bdver3 = [ ]; + bdver4 = [ ]; + znver1 = [ ]; + znver2 = [ ]; + # other + armv5te = [ ]; + armv6 = [ ]; + armv7-a = [ ]; + armv8-a = [ ]; + mips32 = [ ]; + loongson2f = [ ]; + }; + + predicates = { + sse3Support = x: builtins.elem "sse3" features.${x}; + ssse3Support = x: builtins.elem "ssse3" features.${x}; + sse4_1Support = x: builtins.elem "sse4_1" features.${x}; + sse4_2Support = x: builtins.elem "sse4_2" features.${x}; + sse4_aSupport = x: builtins.elem "sse4a" features.${x}; + avxSupport = x: builtins.elem "avx" features.${x}; + avx2Support = x: builtins.elem "avx2" features.${x}; + avx512Support = x: builtins.elem "avx512" features.${x}; + aesSupport = x: builtins.elem "aes" features.${x}; + fmaSupport = x: builtins.elem "fma" features.${x}; + fma4Support = x: builtins.elem "fma4" features.${x}; + }; +} diff --git a/lib/systems/default.nix b/lib/systems/default.nix index c929781dd8ff..02d58592b325 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -7,6 +7,7 @@ rec { inspect = import ./inspect.nix { inherit lib; }; platforms = import ./platforms.nix { inherit lib; }; examples = import ./examples.nix { inherit lib; }; + architectures = import ./architectures.nix { inherit lib; }; # Elaborate a `localSystem` or `crossSystem` so that it contains everything # necessary. @@ -125,6 +126,7 @@ rec { else throw "Don't know how to run ${final.config} executables."; } // mapAttrs (n: v: v final.parsed) inspect.predicates + // mapAttrs (n: v: v final.platform.gcc.arch or "default") architectures.predicates // args; in assert final.useAndroidPrebuilt -> final.isAndroid; assert lib.foldl -- cgit v1.2.3 From 074bc78cc8749faa31729096b65f2ef51b10abeb Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 13 Aug 2020 01:10:21 -0400 Subject: android: update sdk, ndk to 29, 21 --- lib/systems/examples.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index ca562d2e4565..40e2b8fcefbc 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -46,7 +46,7 @@ rec { armv7a-android-prebuilt = { config = "armv7a-unknown-linux-androideabi"; - sdkVer = "24"; + sdkVer = "29"; ndkVer = "18b"; platform = platforms.armv7a-android; useAndroidPrebuilt = true; @@ -54,7 +54,7 @@ rec { aarch64-android-prebuilt = { config = "aarch64-unknown-linux-android"; - sdkVer = "24"; + sdkVer = "29"; ndkVer = "18b"; platform = platforms.aarch64-multiplatform; useAndroidPrebuilt = true; -- cgit v1.2.3 From 55bc2b54a481f08bd9f7189561f9cf2f65f810c7 Mon Sep 17 00:00:00 2001 From: volth Date: Sat, 22 Aug 2020 22:55:13 +0000 Subject: Update architectures.nix --- lib/systems/architectures.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix index 287f5be03c45..ce7ac0356bdc 100644 --- a/lib/systems/architectures.nix +++ b/lib/systems/architectures.nix @@ -35,12 +35,12 @@ rec { # x86_64 Intel default = [ ]; westmere = [ ]; - sandybridge = [ "westmere" ]; - ivybridge = [ "westmere" "sandybridge" ]; - haswell = [ "westmere" "sandybridge" "ivybridge" ]; - broadwell = [ "westmere" "sandybridge" "ivybridge" "haswell" ]; - skylake = [ "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" ]; - skylake-avx512 = [ "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" ]; + sandybridge = [ "westmere" ] ++ inferiors.westmere; + ivybridge = [ "sandybridge" ] ++ inferiors.sandybridge; + haswell = [ "ivybridge" ] ++ inferiors.ivybridge; + broadwell = [ "haswell" ] ++ inferiors.haswell; + skylake = [ "broadwell" ] ++ inferiors.broadwell; + skylake-avx512 = [ "skylake" ] ++ inferiors.skylake; # x86_64 AMD btver1 = [ ]; btver2 = [ ]; -- cgit v1.2.3 From 8ad48c921e6bc5b1a0a273764ef3337747b34503 Mon Sep 17 00:00:00 2001 From: volth Date: Sat, 22 Aug 2020 23:01:38 +0000 Subject: Update architectures.nix --- lib/systems/architectures.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix index ce7ac0356bdc..c9ca27a0651d 100644 --- a/lib/systems/architectures.nix +++ b/lib/systems/architectures.nix @@ -43,13 +43,13 @@ rec { skylake-avx512 = [ "skylake" ] ++ inferiors.skylake; # x86_64 AMD btver1 = [ ]; - btver2 = [ ]; - bdver1 = [ ]; - bdver2 = [ ]; - bdver3 = [ ]; - bdver4 = [ ]; - znver1 = [ ]; - znver2 = [ ]; + btver2 = [ ]; # TODO: fill this (need testing) + bdver1 = [ ]; # TODO: fill this (need testing) + bdver2 = [ ]; # TODO: fill this (need testing) + bdver3 = [ ]; # TODO: fill this (need testing) + bdver4 = [ ]; # TODO: fill this (need testing) + znver1 = [ ]; # TODO: fill this (need testing) + znver2 = [ ]; # TODO: fill this (need testing) # other armv5te = [ ]; armv6 = [ ]; -- cgit v1.2.3 From 60ce27db2b405c0de1b870b2d04056e71d704133 Mon Sep 17 00:00:00 2001 From: volth Date: Sat, 22 Aug 2020 23:04:08 +0000 Subject: Update architectures.nix --- lib/systems/architectures.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'lib/systems') diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix index c9ca27a0651d..acb6e417386b 100644 --- a/lib/systems/architectures.nix +++ b/lib/systems/architectures.nix @@ -59,17 +59,18 @@ rec { loongson2f = [ ]; }; - predicates = { - sse3Support = x: builtins.elem "sse3" features.${x}; - ssse3Support = x: builtins.elem "ssse3" features.${x}; - sse4_1Support = x: builtins.elem "sse4_1" features.${x}; - sse4_2Support = x: builtins.elem "sse4_2" features.${x}; - sse4_aSupport = x: builtins.elem "sse4a" features.${x}; - avxSupport = x: builtins.elem "avx" features.${x}; - avx2Support = x: builtins.elem "avx2" features.${x}; - avx512Support = x: builtins.elem "avx512" features.${x}; - aesSupport = x: builtins.elem "aes" features.${x}; - fmaSupport = x: builtins.elem "fma" features.${x}; - fma4Support = x: builtins.elem "fma4" features.${x}; + predicates = rec { + featureSupport = feature: x: builtins.elem feature features.${x}; + sse3Support = featureSupport "sse3"; + ssse3Support = featureSupport "ssse3"; + sse4_1Support = featureSupport "sse4_1"; + sse4_2Support = featureSupport "sse4_2"; + sse4_aSupport = featureSupport "sse4a"; + avxSupport = featureSupport "avx"; + avx2Support = featureSupport "avx2"; + avx512Support = featureSupport "avx512"; + aesSupport = featureSupport "aes"; + fmaSupport = featureSupport "fma"; + fma4Support = featureSupport "fma4"; }; } -- cgit v1.2.3 From 55195119d529d65e264bcae9ce2741827272efb4 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 24 Aug 2020 21:46:48 -0400 Subject: Distinguish pkgsStatic from pkgsMusl via stdenv.targetPlatform This change allows derivations to distinguish dynamic musl build and static musl build in cases where upstream build system can't detect it by itself. --- 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 c929781dd8ff..09884d406823 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -76,6 +76,7 @@ rec { # uname -r release = null; }; + isStatic = final.isWasm || final.isRedox; kernelArch = if final.isAarch32 then "arm" -- cgit v1.2.3 From c5fe132b3c5da5044c01a9bd4aa4ab45795cb9e6 Mon Sep 17 00:00:00 2001 From: volth Date: Tue, 1 Sep 2020 11:28:34 +0000 Subject: Update architectures.nix --- lib/systems/architectures.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix index acb6e417386b..9d1c29fd9f0b 100644 --- a/lib/systems/architectures.nix +++ b/lib/systems/architectures.nix @@ -59,8 +59,9 @@ rec { loongson2f = [ ]; }; - predicates = rec { + predicates = let featureSupport = feature: x: builtins.elem feature features.${x}; + in { sse3Support = featureSupport "sse3"; ssse3Support = featureSupport "ssse3"; sse4_1Support = featureSupport "sse4_1"; -- cgit v1.2.3