about summary refs log tree commit diff
path: root/pkgs/stdenv/booter.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/booter.nix')
-rw-r--r--pkgs/stdenv/booter.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/stdenv/booter.nix b/pkgs/stdenv/booter.nix
index 51d617354e86..f1d07e6461a9 100644
--- a/pkgs/stdenv/booter.nix
+++ b/pkgs/stdenv/booter.nix
@@ -124,7 +124,13 @@ stageFuns: let
       if buildPackages.stdenv.hasCC
       then
         if buildPackages.stdenv.cc.isClang or false
-        then buildPackages.clang
+        # buildPackages.clang checks targetPackages.stdenv.cc (i. e. this
+        # attribute) to get a sense of the its set's default compiler and
+        # chooses between libc++ and libstdc++ based on that. If we hit this
+        # code here, we'll cause an infinite recursion. Since a set with
+        # clang as its default compiler always means libc++, we can infer this
+        # decision statically.
+        then buildPackages.llvmPackages.libcxxClang
         else buildPackages.gcc
       else
         # This will blow up if anything uses it, but that's OK. The `if