core/pkgs/by-name/gc/gcc/all.nix

56 lines
1.9 KiB
Nix
Raw Normal View History

2024-05-13 21:24:10 +00:00
{ lib, stdenv, gccStdenv, gcc7Stdenv, callPackage, isl_0_11, isl_0_14, isl_0_17
, isl_0_20, libcCross, threadsCrossFor, noSysDirs, texinfo5, cloog_0_18_0, cloog
, lowPrio, wrapCC }@args:
2024-05-02 00:46:19 +00:00
let
versions = import ./versions.nix;
gccForMajorMinorVersion = majorMinorVersion:
let
atLeast = lib.versionAtLeast majorMinorVersion;
2024-05-13 21:24:10 +00:00
attrName = "gcc${lib.replaceStrings [ "." ] [ "" ] majorMinorVersion}";
2024-05-02 00:46:19 +00:00
pkg = lowPrio (wrapCC (callPackage ./default.nix ({
inherit noSysDirs;
inherit majorMinorVersion;
reproducibleBuild = true;
profiledCompiler = false;
2024-05-13 21:24:10 +00:00
libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then
args.libcCross
else
null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then
threadsCrossFor majorMinorVersion
else
{ };
isl = if stdenv.isDarwin then
null
else if atLeast "9" then
isl_0_20
else if atLeast "7" then
isl_0_17
else if atLeast "6" then
(if stdenv.targetPlatform.isRedox then isl_0_17 else isl_0_14)
else if atLeast "4.9" then
isl_0_11
else # "4.8"
isl_0_14;
2024-05-02 00:46:19 +00:00
} // lib.optionalAttrs (majorMinorVersion == "4.8") {
texinfo = texinfo5; # doesn't validate since 6.1 -> 6.3 bump
} // lib.optionalAttrs (!(atLeast "6")) {
2024-05-13 21:24:10 +00:00
cloog = if stdenv.isDarwin then
null
else if atLeast "4.9" then
cloog_0_18_0
else # 4.8
cloog;
2024-05-02 00:46:19 +00:00
} // lib.optionalAttrs (atLeast "6" && !(atLeast "9")) {
# gcc 10 is too strict to cross compile gcc <= 8
2024-05-13 21:24:10 +00:00
stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform)
&& stdenv.cc.isGNU then
gcc7Stdenv
else
stdenv;
2024-05-02 00:46:19 +00:00
})));
2024-05-13 21:24:10 +00:00
in lib.nameValuePair attrName pkg;
in lib.listToAttrs (map gccForMajorMinorVersion versions.allMajorVersions)
2024-05-02 00:46:19 +00:00