From 44649a53e95203abed1a1b1d7876a4a9967a9947 Mon Sep 17 00:00:00 2001 From: pennae Date: Thu, 9 Feb 2023 14:51:24 +0100 Subject: [PATCH] nix: force make to use old-style two-pipe-fds jobserver gcc lto-wrapper uses the make jobserver to speed up linking, and it doesn't support the new fifo:/path style of jobserver-auth yet. it'll still work but use only one thread, so we should stick to the old style for now. --- pkgs/tools/package-management/nix/common.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/tools/package-management/nix/common.nix b/pkgs/tools/package-management/nix/common.nix index d85e40bdc28a..f0032916db9d 100644 --- a/pkgs/tools/package-management/nix/common.nix +++ b/pkgs/tools/package-management/nix/common.nix @@ -181,6 +181,10 @@ self = stdenv.mkDerivation { ]; makeFlags = [ + # gcc runs multi-threaded LTO using make and does not yet detect the new fifo:/path style + # of make jobserver. until gcc adds support for this we have to instruct make to use this + # old style or LTO builds will run their linking on only one thread, which takes forever. + "--jobserver-style=pipe" "profiledir=$(out)/etc/profile.d" ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "PRECOMPILE_HEADERS=0" ++ lib.optional (stdenv.hostPlatform.isDarwin) "PRECOMPILE_HEADERS=1";