| 1 | From fd381c0a449768e8c258e7178fc7c169e80631a9 Mon Sep 17 00:00:00 2001
|
| 2 | From: psykose <[email protected]>
|
| 3 | Date: Mon, 19 Dec 2022 06:10:20 +0000
|
| 4 | Subject: [PATCH] rust-lto-thin.patch
|
| 5 |
|
| 6 | set rust crate lto to thin to not use fatlto for gkrust which fails sometimes
|
| 7 |
|
| 8 | additionally, disable lto on riscv64 altogether
|
| 9 | ---
|
| 10 | python/mozbuild/mozbuild/rust_commands.py | 4 ++--
|
| 11 | 1 file changed, 2 insertions(+), 2 deletions(-)
|
| 12 |
|
| 13 | diff --git a/python/mozbuild/mozbuild/rust_commands.py b/python/mozbuild/mozbuild/rust_commands.py
|
| 14 | index 4167286b96f9f..c2bd983e6c81b 100644
|
| 15 | |
| 16 | |
| 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 | --
|
| 29 | 2.56.0
|
| 30 |
|