From 7078ed0a2b017298151e492d177631aaede149c9 Mon Sep 17 00:00:00 2001 From: suvari Date: Mon, 12 Aug 2024 10:30:39 +0300 Subject: [PATCH] firefox: patches for rust --- network/web/firefox/files/riscv64-no-lto.patch | 16 ++++++++++++++++ network/web/firefox/files/rust-lto-thin.patch | 12 ++++++++++++ network/web/firefox/pspec.xml | 2 ++ 3 files changed, 30 insertions(+) create mode 100644 network/web/firefox/files/riscv64-no-lto.patch create mode 100644 network/web/firefox/files/rust-lto-thin.patch diff --git a/network/web/firefox/files/riscv64-no-lto.patch b/network/web/firefox/files/riscv64-no-lto.patch new file mode 100644 index 0000000000..90c9b5def1 --- /dev/null +++ b/network/web/firefox/files/riscv64-no-lto.patch @@ -0,0 +1,16 @@ +--- a/config/makefiles/rust.mk ++++ b/config/makefiles/rust.mk +@@ -91,11 +91,13 @@ + ifndef rustflags_sancov + # Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045. + ifndef MOZ_CODE_COVERAGE ++ifeq (,$(findstring riscv64,$(RUST_TARGET))) + ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE))) + cargo_rustc_flags += -Clto=thin + endif + # We need -Cembed-bitcode=yes for all crates when using -Clto. + RUSTFLAGS += -Cembed-bitcode=yes ++endif + endif + endif + endif diff --git a/network/web/firefox/files/rust-lto-thin.patch b/network/web/firefox/files/rust-lto-thin.patch new file mode 100644 index 0000000000..788fceab39 --- /dev/null +++ b/network/web/firefox/files/rust-lto-thin.patch @@ -0,0 +1,12 @@ +set rust crate lto to thin to not use fatlto for gkrust which fails sometimes +--- a/config/makefiles/rust.mk ++++ b/config/makefiles/rust.mk +@@ -92,7 +92,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=thin + endif + # We need -Cembed-bitcode=yes for all crates when using -Clto. + RUSTFLAGS += -Cembed-bitcode=yes diff --git a/network/web/firefox/pspec.xml b/network/web/firefox/pspec.xml index b484464ea9..b319b65708 100644 --- a/network/web/firefox/pspec.xml +++ b/network/web/firefox/pspec.xml @@ -77,6 +77,8 @@ jack-audio-connection-kit-devel + rust-lto-thin.patch + riscv64-no-lto.patch