diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 75690367ec937..bd90641c16f27 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -160,9 +160,14 @@ let ${if stdenv.buildPlatform.isGnu then '' ar -cqs $libv8/lib/libv8.a @files '' else '' - cat files | while read -r file; do - ar -cqS $libv8/lib/libv8.a $file - done + # llvm-ar supports response files, so take advantage of it if it’s available. + if [ "$(basename $(readlink -f $(command -v ar)))" = "llvm-ar" ]; then + ar -cqs $libv8/lib/libv8.a @files + else + cat files | while read -r file; do + ar -cqS $libv8/lib/libv8.a $file + done + fi ''} popd