Merge master into staging-next

authored by

nixpkgs-ci[bot] and committed by
GitHub
c77ca57a 7f33f65b

+109 -31
+15
pkgs/development/compilers/ghc/9.0.2-binary.nix
··· 11 numactl, 12 libffi, 13 llvmPackages, 14 coreutils, 15 targetPackages, 16 ··· 214 coreutils # for cat 215 ] 216 ++ lib.optionals useLLVM [ 217 (lib.getBin llvmPackages.llvm) 218 ] 219 # On darwin, we need unwrapped bintools as well (for otool)
··· 11 numactl, 12 libffi, 13 llvmPackages, 14 + replaceVarsWith, 15 coreutils, 16 targetPackages, 17 ··· 215 coreutils # for cat 216 ] 217 ++ lib.optionals useLLVM [ 218 + # Allow the use of newer LLVM versions; see the script for details. 219 + (replaceVarsWith { 220 + name = "subopt"; 221 + src = ./subopt.bash; 222 + dir = "bin"; 223 + isExecutable = true; 224 + preBuild = '' 225 + name=opt 226 + ''; 227 + replacements = { 228 + inherit (stdenv) shell; 229 + opt = lib.getExe' llvmPackages.llvm "opt"; 230 + }; 231 + }) 232 (lib.getBin llvmPackages.llvm) 233 ] 234 # On darwin, we need unwrapped bintools as well (for otool)
+3 -7
pkgs/development/compilers/ghc/9.2.4-binary.nix
··· 10 libiconv, 11 numactl, 12 libffi, 13 - llvmPackages, 14 coreutils, 15 targetPackages, 16 ··· 193 ) binDistUsed.archSpecificLibraries 194 )).nixPackage; 195 196 - useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; }); 197 - 198 libPath = lib.makeLibraryPath ( 199 # Add arch-specific libraries. 200 map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries ··· 207 targetPackages.stdenv.cc.bintools 208 coreutils # for cat 209 ] 210 - ++ lib.optionals useLLVM [ 211 - (lib.getBin llvmPackages.llvm) 212 - ] 213 # On darwin, we need unwrapped bintools as well (for otool) 214 ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ 215 targetPackages.stdenv.cc.bintools.bintools 216 ]; 217 218 in 219 220 stdenv.mkDerivation { 221 inherit version; ··· 470 targetPrefix = ""; 471 enableShared = true; 472 473 - inherit llvmPackages; 474 475 # Our Cabal compiler name 476 haskellCompilerName = "ghc-${version}";
··· 10 libiconv, 11 numactl, 12 libffi, 13 coreutils, 14 targetPackages, 15 ··· 192 ) binDistUsed.archSpecificLibraries 193 )).nixPackage; 194 195 libPath = lib.makeLibraryPath ( 196 # Add arch-specific libraries. 197 map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries ··· 204 targetPackages.stdenv.cc.bintools 205 coreutils # for cat 206 ] 207 # On darwin, we need unwrapped bintools as well (for otool) 208 ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ 209 targetPackages.stdenv.cc.bintools.bintools 210 ]; 211 212 in 213 + 214 + assert import ./common-have-ncg.nix { inherit lib stdenv version; }; 215 216 stdenv.mkDerivation { 217 inherit version; ··· 466 targetPrefix = ""; 467 enableShared = true; 468 469 + llvmPackages = null; 470 471 # Our Cabal compiler name 472 haskellCompilerName = "ghc-${version}";
+3 -7
pkgs/development/compilers/ghc/9.6.3-binary.nix
··· 10 libiconv, 11 numactl, 12 libffi, 13 - llvmPackages, 14 coreutils, 15 targetPackages, 16 ··· 192 ) binDistUsed.archSpecificLibraries 193 )).nixPackage; 194 195 - useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; }); 196 - 197 libPath = lib.makeLibraryPath ( 198 # Add arch-specific libraries. 199 map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries ··· 206 targetPackages.stdenv.cc.bintools 207 coreutils # for cat 208 ] 209 - ++ lib.optionals useLLVM [ 210 - (lib.getBin llvmPackages.llvm) 211 - ] 212 # On darwin, we need unwrapped bintools as well (for otool) 213 ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ 214 targetPackages.stdenv.cc.bintools.bintools 215 ]; 216 217 in 218 219 stdenv.mkDerivation { 220 inherit version; ··· 449 targetPrefix = ""; 450 enableShared = true; 451 452 - inherit llvmPackages; 453 454 # Our Cabal compiler name 455 haskellCompilerName = "ghc-${version}";
··· 10 libiconv, 11 numactl, 12 libffi, 13 coreutils, 14 targetPackages, 15 ··· 191 ) binDistUsed.archSpecificLibraries 192 )).nixPackage; 193 194 libPath = lib.makeLibraryPath ( 195 # Add arch-specific libraries. 196 map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries ··· 203 targetPackages.stdenv.cc.bintools 204 coreutils # for cat 205 ] 206 # On darwin, we need unwrapped bintools as well (for otool) 207 ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ 208 targetPackages.stdenv.cc.bintools.bintools 209 ]; 210 211 in 212 + 213 + assert import ./common-have-ncg.nix { inherit lib stdenv version; }; 214 215 stdenv.mkDerivation { 216 inherit version; ··· 445 targetPrefix = ""; 446 enableShared = true; 447 448 + llvmPackages = null; 449 450 # Our Cabal compiler name 451 haskellCompilerName = "ghc-${version}";
+3 -7
pkgs/development/compilers/ghc/9.8.4-binary.nix
··· 9 libiconv, 10 numactl, 11 libffi, 12 - llvmPackages, 13 coreutils, 14 targetPackages, 15 ··· 206 ) binDistUsed.archSpecificLibraries 207 )).nixPackage; 208 209 - useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; }); 210 - 211 libPath = lib.makeLibraryPath ( 212 # Add arch-specific libraries. 213 map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries ··· 220 targetPackages.stdenv.cc.bintools 221 coreutils # for cat 222 ] 223 - ++ lib.optionals useLLVM [ 224 - (lib.getBin llvmPackages.llvm) 225 - ] 226 # On darwin, we need unwrapped bintools as well (for otool) 227 ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ 228 targetPackages.stdenv.cc.bintools.bintools 229 ]; 230 231 in 232 233 stdenv.mkDerivation { 234 inherit version; ··· 464 targetPrefix = ""; 465 enableShared = true; 466 467 - inherit llvmPackages; 468 469 # Our Cabal compiler name 470 haskellCompilerName = "ghc-${version}";
··· 9 libiconv, 10 numactl, 11 libffi, 12 coreutils, 13 targetPackages, 14 ··· 205 ) binDistUsed.archSpecificLibraries 206 )).nixPackage; 207 208 libPath = lib.makeLibraryPath ( 209 # Add arch-specific libraries. 210 map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries ··· 217 targetPackages.stdenv.cc.bintools 218 coreutils # for cat 219 ] 220 # On darwin, we need unwrapped bintools as well (for otool) 221 ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ 222 targetPackages.stdenv.cc.bintools.bintools 223 ]; 224 225 in 226 + 227 + assert import ./common-have-ncg.nix { inherit lib stdenv version; }; 228 229 stdenv.mkDerivation { 230 inherit version; ··· 460 targetPrefix = ""; 461 enableShared = true; 462 463 + llvmPackages = null; 464 465 # Our Cabal compiler name 466 haskellCompilerName = "ghc-${version}";
+80
pkgs/development/compilers/ghc/subopt.bash
···
··· 1 + #!@shell@ 2 + 3 + # This script wraps the LLVM `opt(1)` executable and maps the options 4 + # passed by old versions of GHC to the equivalents passed by newer 5 + # versions that support recent versions of LLVM. 6 + # 7 + # It achieves the same effect as the following GHC change externally: 8 + # <https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8999>. 9 + # 10 + # This is used solely for bootstrapping newer GHCs from the GHC 9.0.2 11 + # binary on AArch64, as that is the only architecture supported by that 12 + # binary distribution that requires LLVM, and our later binary packages 13 + # all use the native code generator for all supported platforms. 14 + # 15 + # No attempt is made to support custom LLVM optimization flags, or the 16 + # undocumented flag to disable TBAA, or avoid 17 + # <https://gitlab.haskell.org/ghc/ghc/-/issues/23870>, as these are not 18 + # required to bootstrap GHC and at worst will produce an error message. 19 + # 20 + # It is called `subopt` to reflect the fact that it uses `opt(1)` as a 21 + # subprocess, and the fact that the GHC build system situation 22 + # requiring this hack is suboptimal. 23 + 24 + set -e 25 + 26 + expect() { 27 + if [[ $1 != $2 ]]; then 28 + printf >&2 'subopt: got %q; expected %q\n' "$1" "$2" 29 + return 2 30 + fi 31 + } 32 + 33 + if [[ $NIX_DEBUG -ge 1 ]]; then 34 + printf >&2 'subopt: before:' 35 + printf >&2 ' %q' "$@" 36 + printf >&2 '\n' 37 + fi 38 + 39 + args=() 40 + 41 + while [[ $# -gt 0 ]]; do 42 + case "$1" in 43 + -enable-new-pm=0) 44 + shift 1 45 + ;; 46 + -mem2reg) 47 + expect "$2" -globalopt 48 + expect "$3" -lower-expect 49 + expect "$4" -enable-tbaa 50 + expect "$5" -tbaa 51 + args+=('-passes=function(require<tbaa>),function(mem2reg),globalopt,function(lower-expect)') 52 + shift 5 53 + ;; 54 + -O1) 55 + expect "$2" -globalopt 56 + expect "$3" -enable-tbaa 57 + expect "$4" -tbaa 58 + args+=('-passes=default<O1>') 59 + shift 4 60 + ;; 61 + -O2) 62 + expect "$2" -enable-tbaa 63 + expect "$3" -tbaa 64 + args+=('-passes=default<O2>') 65 + shift 3 66 + ;; 67 + *) 68 + args+=("$1") 69 + shift 1 70 + ;; 71 + esac 72 + done 73 + 74 + if [[ $NIX_DEBUG -ge 1 ]]; then 75 + printf >&2 'subopt: after:' 76 + printf >&2 ' %q' "${args[@]}" 77 + printf >&2 '\n' 78 + fi 79 + 80 + exec @opt@ "${args[@]}"
+5 -10
pkgs/top-level/haskell-packages.nix
··· 70 bb = pkgsBuildBuild.haskell; 71 in 72 { 73 ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix { 74 - llvmPackages = pkgs.llvmPackages_12; 75 }; 76 77 - ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix { 78 - llvmPackages = pkgs.llvmPackages_12; 79 - }; 80 81 - ghc963Binary = callPackage ../development/compilers/ghc/9.6.3-binary.nix { 82 - llvmPackages = pkgs.llvmPackages_15; 83 - }; 84 85 - ghc984Binary = callPackage ../development/compilers/ghc/9.8.4-binary.nix { 86 - llvmPackages = pkgs.llvmPackages_15; 87 - }; 88 89 ghc948 = callPackage ../development/compilers/ghc/9.4.8.nix { 90 bootPkgs =
··· 70 bb = pkgsBuildBuild.haskell; 71 in 72 { 73 + # Required to bootstrap 9.4.8. 74 ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix { 75 + llvmPackages = pkgs.llvmPackages_20; 76 }; 77 78 + ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix { }; 79 80 + ghc963Binary = callPackage ../development/compilers/ghc/9.6.3-binary.nix { }; 81 82 + ghc984Binary = callPackage ../development/compilers/ghc/9.8.4-binary.nix { }; 83 84 ghc948 = callPackage ../development/compilers/ghc/9.4.8.nix { 85 bootPkgs =