From fd381c0a449768e8c258e7178fc7c169e80631a9 Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 19 Dec 2022 06:10:20 +0000 Subject: [PATCH] rust-lto-thin.patch set rust crate lto to thin to not use fatlto for gkrust which fails sometimes additionally, disable lto on riscv64 altogether --- python/mozbuild/mozbuild/rust_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mozbuild/mozbuild/rust_commands.py b/python/mozbuild/mozbuild/rust_commands.py index 4167286b96f9f..c2bd983e6c81b 100644 --- a/python/mozbuild/mozbuild/rust_commands.py +++ b/python/mozbuild/mozbuild/rust_commands.py @@ -417,8 +417,8 @@ def _rustc_flags(cmd, substs, invocation): if cmd.kind == "library": flags += substs.get("MOZ_RUST_LIBRARY_RUSTCFLAGS") - if applies_library_lto(cmd.kind, cmd.lto, substs): - flags.append("-Clto") + if applies_library_lto(cmd.kind, cmd.lto, substs) and "riscv64" not in substs.get("RUST_TARGET"): + flags.append("-Clto=thin") flags += invocation.cargo_rustcflags -- 2.56.0