diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index 5de10bf97f0e..e3f8c25ad46c 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -222,6 +222,15 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; + # Darwin uses the system libc++ by default. It is set up as its own clang definition so that `libcxxClang` + # continues to use the libc++ from LLVM. + systemLibcxxClang = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = darwin.libcxx; + extraPackages = [ targetLlvmLibraries.compiler-rt ]; + extraBuildCommands = mkExtraBuildCommands cc; + }; + lld = callPackage ./lld { };