From 2cb9593cad3a351d064621def6875eee78feaecb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 27 Mar 2022 17:12:20 +0200 Subject: [PATCH] firefox: always build with clang Both LTO and PGO require the use of clang so I think its easier to just stick with clang for all builds, so PGO and LTO could in theory be used without each other. --- .../networking/browsers/firefox/common.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 63b2195d96b3..d5ade4ffd42a 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -141,12 +141,10 @@ let bootBintools = null; }; - buildStdenv = if ltoSupport - # LTO requires LLVM bintools including ld.lld and llvm-ar. - then overrideCC llvmPackages.stdenv (llvmPackages.stdenv.cc.override { - inherit (llvmPackages) bintools; - }) - else stdenv; + # LTO requires LLVM bintools including ld.lld and llvm-ar. + buildStdenv = overrideCC llvmPackages.stdenv (llvmPackages.stdenv.cc.override { + inherit (llvmPackages) bintools; + }); # Compile the wasm32 sysroot to build the RLBox Sandbox # https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/ @@ -289,7 +287,6 @@ buildStdenv.mkDerivation ({ "--with-system-webp" "--with-system-zlib" ] - ++ lib.optional (!ltoSupport) "--with-clang-path=${llvmPackages.clang}/bin/clang" # LTO is done using clang and lld on Linux. ++ lib.optionals ltoSupport [ "--enable-lto=cross" # Cross-Language LTO