compilation for particular x86_64 architecture

This commit is contained in:
volth
2019-04-30 14:28:04 +00:00
parent f454785bb4
commit 5ad79dc4bb
16 changed files with 92 additions and 76 deletions
@@ -60,6 +60,7 @@ let
${optionalString (isNix20 && !cfg.distributedBuilds) ''
builders =
''}
system-features = ${toString cfg.systemFeatures}
$extraOptions
END
'' + optionalString cfg.checkConfig (
@@ -360,6 +361,15 @@ in
'';
};
systemFeatures = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "kvm" "big-parallel" "gccarch-skylake" ];
description = ''
The supported features of a machine
'';
};
checkConfig = mkOption {
type = types.bool;
default = true;
@@ -478,6 +488,21 @@ in
/nix/var/nix/gcroots/tmp
'';
nix.systemFeatures = mkIf (pkgs.stdenv.isx86_64 && pkgs.hostPlatform.platform ? gcc.arch) (
# can build for arch
mkDefault (
[ "nixos-test" "benchmark" "big-parallel" "kvm" "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++
{ # can also run code for the following achritectures:
"sandybridge" = [ "gccarch-westmere" ];
"ivybridge" = [ "gccarch-westmere" "gccarch-sandybridge" ];
"haswell" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" ];
"broadwell" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" ];
"skylake" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" ];
"skylake-avx512" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" "gccarch-skylake" ];
}.${pkgs.hostPlatform.platform.gcc.arch}
)
);
};
}