commit:     d7f3dfefc2ab978d5d38b50d1e061c4a530d85f8
Author:     Randy Barlow <randy <AT> electronsweatshop <DOT> com>
AuthorDate: Sun Mar 17 03:00:43 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 21 02:22:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7f3dfef

dev-lang/rust: Disable LTO by default and use thin

We've had a few issues with lto on, and it isn't on by default generally
among Gentoo packages, so this commit flips it to be off by default.

Additionally, in an upstream ticket[0] it was suggested to use thin LTO
rather than fat LTO, so this commit makes that adjustment as well.

[0] https://github.com/rust-lang/rust/issues/121124

[sam: Note that there's a risk of miscompilations with non-thin LTO, per the
upstream bug(s).]

Bug: https://bugs.gentoo.org/924301
Signed-off-by: Randy Barlow <randy <AT> electronsweatshop.com>
Closes: https://github.com/gentoo/gentoo/pull/35796
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/rust/{rust-1.76.0.ebuild => rust-1.76.0-r1.ebuild} | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dev-lang/rust/rust-1.76.0.ebuild 
b/dev-lang/rust/rust-1.76.0-r1.ebuild
similarity index 99%
rename from dev-lang/rust/rust-1.76.0.ebuild
rename to dev-lang/rust/rust-1.76.0-r1.ebuild
index 5c6cef79e27f..eb175488528c 100644
--- a/dev-lang/rust/rust-1.76.0.ebuild
+++ b/dev-lang/rust/rust-1.76.0-r1.ebuild
@@ -42,7 +42,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
 
 LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
 
-IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind +lto 
miri nightly parallel-compiler profiler rustfmt rust-analyzer rust-src 
system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
+IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto 
miri nightly parallel-compiler profiler rustfmt rust-analyzer rust-src 
system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
 
 # Please keep the LLVM dependency block separate. Since LLVM is slotted,
 # we need to *really* make sure we're not pulling more than one slot
@@ -469,7 +469,8 @@ src_configure() {
                deny-warnings = $(usex wasm $(usex doc false true) true)
                backtrace-on-ice = true
                jemalloc = false
-               lto = "$(usex lto fat off)"
+               # See https://github.com/rust-lang/rust/issues/121124
+               lto = "$(usex lto thin off)"
                [dist]
                src-tarball = false
                compression-formats = ["xz"]

Reply via email to