projects/aports·blob master · refs

30 lines · 1.1 KiB

1From fd381c0a449768e8c258e7178fc7c169e80631a9 Mon Sep 17 00:00:00 2001
2From: psykose <[email protected]>
3Date: Mon, 19 Dec 2022 06:10:20 +0000
4Subject: [PATCH] rust-lto-thin.patch
5
6set rust crate lto to thin to not use fatlto for gkrust which fails sometimes
7
8additionally, disable lto on riscv64 altogether
9---
10 python/mozbuild/mozbuild/rust_commands.py | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/python/mozbuild/mozbuild/rust_commands.py b/python/mozbuild/mozbuild/rust_commands.py
14index 4167286b96f9f..c2bd983e6c81b 100644
15--- a/python/mozbuild/mozbuild/rust_commands.py
16+++ b/python/mozbuild/mozbuild/rust_commands.py
17@@ -417,8 +417,8 @@ def _rustc_flags(cmd, substs, invocation):
18 if cmd.kind == "library":
19 flags += substs.get("MOZ_RUST_LIBRARY_RUSTCFLAGS")
20
21- if applies_library_lto(cmd.kind, cmd.lto, substs):
22- flags.append("-Clto")
23+ if applies_library_lto(cmd.kind, cmd.lto, substs) and "riscv64" not in substs.get("RUST_TARGET"):
24+ flags.append("-Clto=thin")
25
26 flags += invocation.cargo_rustcflags
27
28--
292.56.0
30