From 5f0d21d9e7ed72fd6ce29042fcec637ecbbdf5f8 Mon Sep 17 00:00:00 2001 From: Tim W <16214296+Tim-Wsm@users.noreply.github.com> Date: Fri, 20 Dec 2024 19:32:30 +0100 Subject: [PATCH] firefox: extend compile flag "--enable-lto=cross" with parameter "full" This fixes a regression in the discord web app. The issue was reported in: https://github.com/NixOS/nixpkgs/issues/332540 The regression was introduced in commit 23d4f834 via an upgrade of rust compiler from 1.77.2 to 1.78.0. The fix is based on a comparison between the generated firefox build script generated by pkgs/applications/networking/browsers/firefox/common.nix and the firefox build script of archlinux found at: https://gitlab.archlinux.org/archlinux/packaging/packages/firefox/-/blob/1376cddc7e29fe049fd4afc15fc3b7da5e5fc99b/PKGBUILD Enabling "full" link time optimization fixed the regression in the discord web app. Further compile flags where not ported from the archlinux build script. --- pkgs/applications/networking/browsers/firefox/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index dba2d1edaa7ed..89db23cf980fa 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -406,7 +406,7 @@ buildStdenv.mkDerivation { ] # LTO is done using clang and lld on Linux. ++ lib.optionals ltoSupport [ - "--enable-lto=cross" # Cross-Language LTO + "--enable-lto=cross,full" # Cross-Language LTO "--enable-linker=lld" ] ++ lib.optional (isElfhackPlatform stdenv) (enableFeature elfhackSupport "elf-hack")