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.
This commit is contained in:
Tim W
2024-12-20 19:32:30 +01:00
parent 2b4f91db59
commit 5f0d21d9e7
@@ -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")