diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix index 13be73967143..6c87366ea315 100644 --- a/pkgs/development/compilers/llvm/13/default.nix +++ b/pkgs/development/compilers/llvm/13/default.nix @@ -244,7 +244,12 @@ let inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.clangNoLibcxx - else stdenv; + else ( + # libcxx >= 13 does not build on gcc9 + if stdenv.cc.isGNU && lib.versionOlder stdenv.cc.version "10" + then pkgs.gcc10Stdenv + else stdenv + ); }; libcxxabi = callPackage ./libcxxabi {