[packages/firefox] apply changes for custom rust lto from thunderbird

atler atler at pld-linux.org
Wed Oct 29 11:35:12 CET 2025


commit 514782e93af986826e563d1135b185167954faf6
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Oct 29 01:51:03 2025 +0100

    apply changes for custom rust lto from thunderbird

 custom-rust-lto.patch | 11 +++++++++++
 firefox.spec          | 10 ++++++++++
 2 files changed, 21 insertions(+)
---
diff --git a/firefox.spec b/firefox.spec
index 4263514..d8f4037 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -286,6 +286,7 @@ Source201:	https://releases.mozilla.org/pub/firefox/releases/%{version}/linux-i6
 # Source201-md5:	6c9594e1fd7de4643abc334251b1e4a1
 Source202:	https://releases.mozilla.org/pub/firefox/releases/%{version}/linux-i686/xpi/zh-TW.xpi
 # Source202-md5:	f53b4ee371c16e99d3e6c64b34da0c17
+Patch0:		custom-rust-lto.patch
 Patch1:		system-av1-link.patch
 Patch4:		%{name}-prefs.patch
 Patch5:		%{name}-pld-bookmarks.patch
@@ -2168,6 +2169,7 @@ for s in %sources; do
 	esac
 done
 
+%patch -P0 -p1
 %patch -P1 -p1
 %patch -P4 -p1
 %patch -P5 -p1
@@ -2295,6 +2297,14 @@ export MOZ_PARALLEL_BUILD
 %{?__jobs:export MOZ_PARALLEL_BUILD="%__jobs"}
 %endif
 
+%if %{with lowmem}
+export RUST_LTO="thin"
+%endif
+
+%if %{with lowmem2}
+export RUST_LTO="none"
+%endif
+
 export MOZ_SERVICES_SYNC="1"
 export MOZBUILD_STATE_PATH="$(pwd)/.mozbuild"
 export MACH_SYSTEM_ASSERTED_COMPATIBLE_WITH_BUILD_SITE=1
diff --git a/custom-rust-lto.patch b/custom-rust-lto.patch
new file mode 100644
index 0000000..df9d91b
--- /dev/null
+++ b/custom-rust-lto.patch
@@ -0,0 +1,11 @@
+--- thunderbird-144.0/config/makefiles/rust.mk.orig	2025-10-10 21:53:14.000000000 +0200
++++ thunderbird-144.0/config/makefiles/rust.mk	2025-10-19 02:21:26.649027973 +0200
+@@ -101,7 +101,7 @@
+ # Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045.
+ ifndef MOZ_CODE_COVERAGE
+ ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat)
++cargo_rustc_flags += -Clto$(if $(RUST_LTO),=$(RUST_LTO),$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat))
+ endif
+ # We need -Cembed-bitcode=yes for all crates when using -Clto.
+ RUSTFLAGS += -Cembed-bitcode=yes
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/firefox.git/commitdiff/55674510c50b6f87fb9491cdbc93b49ab1c3aa4f



More information about the pld-cvs-commit mailing list