diff --git a/nix/packages.nix b/nix/packages.nix index 94981cf8f2..8fe3c7e1b4 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -4,7 +4,7 @@ let nix-pinned = writeShellScriptBin "nix" '' ${nix.defaultPackage.${system}}/bin/nix --experimental-features 'nix-command flakes' --extra-substituters https://lean4.cachix.org/ --option warn-dirty false "$@" ''; - llvmPackages = llvmPackages_10; + llvmPackages = llvmPackages_12; cc = (ccacheWrapper.override rec { cc = llvmPackages.clang; extraConfig = '' @@ -25,9 +25,15 @@ let # https://github.com/NixOS/nixpkgs/issues/119779 installPhase = builtins.replaceStrings ["use_response_file_by_default=1"] ["use_response_file_by_default=0"] old.installPhase; }); - stdenv = overrideCC llvmPackages.stdenv cc; + stdenv' = if stdenv.isLinux then useGoldLinker stdenv else stdenv // { + mkDerivation = args: stdenv.mkDerivation (args // { + # https://github.com/NixOS/nixpkgs/issues/130963 + NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + " -lc++abi"; + }); + }; + lean = callPackage (import ./bootstrap.nix) (args // { - stdenv = if stdenv.isLinux then useGoldLinker stdenv else stdenv; + stdenv = stdenv'; inherit buildLeanPackage; }); makeOverridableLeanPackage = f: