Description: Do not enable LTO for rustc when building on arm64 and armhf,
 to work around OOM failures on Launchpad builders. Note that this alone is not
 sufficient, because by default cargo will also enable full LTO when building
 with a release profile, so the top-level Cargo.toml file needs to be
 conditionally patched (this is done in debian/build/rules.mk).
Author: Olivier Tilloy <olivier.tilloy@canonical.com>
Forwarded: not-needed

--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -70,8 +70,10 @@ ifndef MOZ_DEBUG_RUST
 # 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)))
+ifeq (,$(filter aarch64 arm,$(TARGET_CPU)))
 cargo_rustc_flags += -Clto$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat)
 endif
+endif
 # We need -Cembed-bitcode=yes for all crates when using -Clto.
 RUSTFLAGS += -Cembed-bitcode=yes
 endif

