2024-07-07 04:43:37 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
callPackage,
|
|
|
|
stdenvAdapters,
|
|
|
|
buildPackages,
|
|
|
|
targetPackages,
|
|
|
|
stdenv,
|
|
|
|
gcc12Stdenv,
|
|
|
|
pkgs,
|
2024-08-08 03:05:28 +00:00
|
|
|
recurseIntoAttrs,
|
2024-07-07 04:43:37 +00:00
|
|
|
# This is the default binutils, but with *this* version of LLD rather
|
|
|
|
# than the default LLVM version's, if LLD is the choice. We use these for
|
|
|
|
# the `useLLVM` bootstrapping below.
|
|
|
|
bootBintoolsNoLibc ? if stdenv.targetPlatform.linker == "lld" then null else pkgs.bintoolsNoLibc,
|
|
|
|
bootBintools ? if stdenv.targetPlatform.linker == "lld" then null else pkgs.bintools,
|
|
|
|
llvmVersions ? { },
|
2024-09-14 14:37:31 +00:00
|
|
|
# Allows passthrough to packages via newScope in ./common/default.nix.
|
|
|
|
# This makes it possible to do
|
|
|
|
# `(llvmPackages.override { <someLlvmDependency> = bar; }).clang` and get
|
|
|
|
# an llvmPackages whose packages are overridden in an internally consistent way.
|
|
|
|
...
|
|
|
|
}@packageSetArgs:
|
2024-07-07 04:43:37 +00:00
|
|
|
let
|
|
|
|
versions = {
|
2024-10-05 22:32:56 +00:00
|
|
|
"12.0.1".officialRelease.sha256 = "08s5w2db9imb2yaqsvxs6pg21csi1cf6wa35rf8x6q07mam7j8qv";
|
2024-07-07 04:43:37 +00:00
|
|
|
"13.0.1".officialRelease.sha256 = "06dv6h5dmvzdxbif2s8njki6h32796v368dyb5945x8gjj72xh7k";
|
|
|
|
"14.0.6".officialRelease.sha256 = "sha256-vffu4HilvYwtzwgq+NlS26m65DGbp6OSSne2aje1yJE=";
|
|
|
|
"15.0.7".officialRelease.sha256 = "sha256-wjuZQyXQ/jsmvy6y1aksCcEDXGBjuhpgngF3XQJ/T4s=";
|
|
|
|
"16.0.6".officialRelease.sha256 = "sha256-fspqSReX+VD+Nl/Cfq+tDcdPtnQPV1IRopNDfd5VtUs=";
|
|
|
|
"17.0.6".officialRelease.sha256 = "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag=";
|
|
|
|
"18.1.8".officialRelease.sha256 = "sha256-iiZKMRo/WxJaBXct9GdAcAT3cz9d9pnAcO1mmR6oPNE=";
|
2024-11-20 02:30:54 +00:00
|
|
|
"19.1.4".officialRelease.sha256 = "sha256-qi1a/AWxF5j+4O38VQ2R/tvnToVAlMjgv9SP0PNWs3g=";
|
2024-07-24 04:35:28 +00:00
|
|
|
"20.0.0-git".gitRelease = {
|
2024-10-07 14:46:03 +00:00
|
|
|
rev = "0e8555d4dbfdfeddc01dc2ecf9a9b6e804f7b645";
|
|
|
|
rev-version = "20.0.0-unstable-2024-10-07";
|
|
|
|
sha256 = "sha256-Rn8TkTUJKGFZ7uM1RiFOHIDTfpwEhLDpDh1zxVtTYG8=";
|
2024-07-07 04:43:37 +00:00
|
|
|
};
|
|
|
|
} // llvmVersions;
|
|
|
|
|
|
|
|
mkPackage =
|
|
|
|
{
|
|
|
|
name ? null,
|
|
|
|
officialRelease ? null,
|
|
|
|
gitRelease ? null,
|
|
|
|
monorepoSrc ? null,
|
|
|
|
version ? null,
|
|
|
|
}@args:
|
|
|
|
let
|
|
|
|
inherit
|
|
|
|
(import ./common/common-let.nix {
|
|
|
|
inherit lib;
|
2024-07-10 13:51:58 +00:00
|
|
|
inherit gitRelease officialRelease version;
|
2024-07-07 04:43:37 +00:00
|
|
|
})
|
|
|
|
releaseInfo
|
|
|
|
;
|
|
|
|
inherit (releaseInfo) release_version;
|
|
|
|
attrName =
|
|
|
|
args.name or (if (gitRelease != null) then "git" else lib.versions.major release_version);
|
|
|
|
in
|
2024-07-23 01:49:09 +00:00
|
|
|
lib.nameValuePair attrName (
|
2024-08-08 03:05:28 +00:00
|
|
|
recurseIntoAttrs (
|
2024-09-14 14:37:31 +00:00
|
|
|
callPackage ./common (
|
|
|
|
{
|
|
|
|
inherit (stdenvAdapters) overrideCC;
|
|
|
|
buildLlvmTools = buildPackages."llvmPackages_${attrName}".tools;
|
|
|
|
targetLlvmLibraries =
|
2024-11-10 00:23:24 +00:00
|
|
|
# Allow overriding targetLlvmLibraries; this enables custom runtime builds.
|
|
|
|
packageSetArgs.targetLlvmLibraries or targetPackages."llvmPackages_${attrName}".libraries
|
|
|
|
or llvmPackages."${attrName}".libraries;
|
2024-09-14 14:37:31 +00:00
|
|
|
targetLlvm = targetPackages."llvmPackages_${attrName}".llvm or llvmPackages."${attrName}".llvm;
|
|
|
|
inherit
|
|
|
|
officialRelease
|
|
|
|
gitRelease
|
|
|
|
monorepoSrc
|
|
|
|
version
|
|
|
|
;
|
|
|
|
}
|
|
|
|
// packageSetArgs # Allow overrides.
|
|
|
|
// {
|
|
|
|
stdenv =
|
|
|
|
if (lib.versions.major release_version == "13" && stdenv.cc.cc.isGNU or false) then
|
|
|
|
gcc12Stdenv
|
|
|
|
else
|
|
|
|
stdenv; # does not build with gcc13
|
|
|
|
}
|
|
|
|
)
|
2024-08-08 03:05:28 +00:00
|
|
|
)
|
2024-07-23 01:49:09 +00:00
|
|
|
);
|
2024-07-07 04:43:37 +00:00
|
|
|
|
2024-07-23 01:49:09 +00:00
|
|
|
llvmPackages = lib.mapAttrs' (version: args: mkPackage (args // { inherit version; })) versions;
|
2024-07-07 04:43:37 +00:00
|
|
|
in
|
2024-08-08 03:06:56 +00:00
|
|
|
llvmPackages // { inherit mkPackage; }
|