Merge pull request #86223 from pikajude/darwin-static-eval
pkgsStatic: use clang for C compiler on Darwin
This commit is contained in:
@@ -15,7 +15,7 @@ rec {
|
||||
# Used to override packages in stdenv like Make. Should not be used
|
||||
# for other dependencies.
|
||||
overrideInStdenv = stdenv: pkgs:
|
||||
stdenv.override (prev: { allowedRequisites = null; extraBuildInputs = prev.extraBuildInputs or [] ++ pkgs; });
|
||||
stdenv.override (prev: { allowedRequisites = null; extraBuildInputs = (prev.extraBuildInputs or []) ++ pkgs; });
|
||||
|
||||
|
||||
# Override the setup script of stdenv. Useful for testing new
|
||||
@@ -34,7 +34,7 @@ rec {
|
||||
makeStaticBinaries = stdenv:
|
||||
let stdenv' = if stdenv.hostPlatform.libc != "glibc" then stdenv else
|
||||
stdenv.override (prev: {
|
||||
extraBuildInputs = prev.extraBuildInputs or [] ++ [
|
||||
extraBuildInputs = (prev.extraBuildInputs or []) ++ [
|
||||
stdenv.glibc.static
|
||||
];
|
||||
});
|
||||
|
||||
@@ -63,6 +63,8 @@ in lib.init bootStages ++ [
|
||||
# `tryEval` wouldn't catch, wrecking accessing previous stages
|
||||
# when there is a C compiler and everything should be fine.
|
||||
then throw "no C compiler provided for this platform"
|
||||
else if crossSystem.isDarwin
|
||||
then buildPackages.llvmPackages.clang
|
||||
else if crossSystem.useLLVM or false
|
||||
then buildPackages.llvmPackages_8.lldClang
|
||||
else buildPackages.gcc;
|
||||
|
||||
Reference in New Issue
Block a user