llvmPackages.libcxx: use a bootstrap stdenv on Darwin

Using a bootstrap stdenv is needed to avoid infinite recursions that
occur due to inputs propagated by SDK that depend on libc++.
This commit is contained in:
Randy Eckenrode
2024-10-10 16:23:02 -04:00
parent 3e5acdacdd
commit 18211adceb
@@ -1120,7 +1120,11 @@ let
)
# https://github.com/llvm/llvm-project/issues/64226
(metadata.getVersionFile "libcxx/0001-darwin-10.12-mbstate_t-fix.patch");
stdenv = overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt;
stdenv =
if stdenv.hostPlatform.isDarwin then
overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRt
else
overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt;
}
// lib.optionalAttrs (lib.versionOlder metadata.release_version "14") {
# TODO: remove this, causes LLVM 13 packages rebuild.