2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, gccStdenv
|
2024-09-19 14:19:46 +00:00
|
|
|
, gcc9Stdenv
|
2023-11-16 04:20:00 +00:00
|
|
|
, callPackage
|
2024-09-19 14:19:46 +00:00
|
|
|
, isl_0_17, isl_0_20
|
2023-11-16 04:20:00 +00:00
|
|
|
, libcCross
|
2024-06-05 15:53:02 +00:00
|
|
|
, threadsCross
|
2023-11-16 04:20:00 +00:00
|
|
|
, noSysDirs
|
|
|
|
, lowPrio
|
|
|
|
, wrapCC
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
let
|
|
|
|
versions = import ./versions.nix;
|
|
|
|
gccForMajorMinorVersion = majorMinorVersion:
|
|
|
|
let
|
|
|
|
atLeast = lib.versionAtLeast majorMinorVersion;
|
|
|
|
attrName = "gcc${lib.replaceStrings ["."] [""] majorMinorVersion}";
|
|
|
|
pkg = lowPrio (wrapCC (callPackage ./default.nix ({
|
|
|
|
inherit noSysDirs;
|
|
|
|
inherit majorMinorVersion;
|
|
|
|
reproducibleBuild = true;
|
|
|
|
profiledCompiler = false;
|
|
|
|
libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then args.libcCross else null;
|
2024-06-05 15:53:02 +00:00
|
|
|
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { };
|
2024-09-26 11:04:55 +00:00
|
|
|
isl = if stdenv.hostPlatform.isDarwin then null
|
2023-11-16 04:20:00 +00:00
|
|
|
else if atLeast "9" then isl_0_20
|
2024-09-19 14:19:46 +00:00
|
|
|
else /* atLeast "7" */ isl_0_17;
|
|
|
|
} // lib.optionalAttrs (!(atLeast "9")) {
|
2023-11-16 04:20:00 +00:00
|
|
|
# gcc 10 is too strict to cross compile gcc <= 8
|
2024-09-19 14:19:46 +00:00
|
|
|
stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc9Stdenv else stdenv;
|
2023-11-16 04:20:00 +00:00
|
|
|
})));
|
|
|
|
in
|
|
|
|
lib.nameValuePair attrName pkg;
|
|
|
|
in
|
|
|
|
lib.listToAttrs (map gccForMajorMinorVersion versions.allMajorVersions)
|
|
|
|
|