From d2af381b40b4d915c79e0cf248340c1f2bea6895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 7 Mar 2021 08:51:11 +0100 Subject: [PATCH] firefox: build in 32-bit systems Disabling "-g" and LTO so there aren't memory problems. --- .../networking/browsers/firefox/common.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index fb340ee1acee..7518e3993820 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -23,7 +23,7 @@ , ffmpegSupport ? true , gtk3Support ? true, gtk2, gtk3, wrapGAppsHook , waylandSupport ? true, libxkbcommon -, ltoSupport ? stdenv.isLinux, overrideCC, buildPackages +, ltoSupport ? (stdenv.isLinux && stdenv.is64bit), overrideCC, buildPackages , gssSupport ? true, kerberos , pipewireSupport ? waylandSupport && webrtcSupport, pipewire @@ -111,6 +111,13 @@ let else stdenv; nss_pkg = if lib.versionOlder ffversion "83" then nss_3_53 else nss; + + # --enable-release adds -ffunction-sections & LTO that require a big amount of + # RAM and the 32-bit memory space cannot handle that linking + # We also disable adding "-g" for easier linking + releaseFlags = if stdenv.is32bit + then [ "--disable-release" "--disable-debug-symbols" ] + else [ "--enable-release" ]; in buildStdenv.mkDerivation ({ @@ -296,9 +303,9 @@ buildStdenv.mkDerivation ({ ++ lib.optional drmSupport "--enable-eme=widevine" ++ (if debugBuild then [ "--enable-debug" "--enable-profiling" ] - else [ "--disable-debug" "--enable-release" + else ([ "--disable-debug" "--enable-optimize" - "--enable-strip" ]) + "--enable-strip" ] ++ releaseFlags)) ++ lib.optional enableOfficialBranding "--enable-official-branding" ++ extraConfigureFlags;