summaryrefslogtreecommitdiff
path: root/dev-lang/rust/rust-9999.ebuild
diff options
context:
space:
mode:
authorZ. Liu <zhixu.liu@gmail.com>2025-02-26 23:18:52 +0800
committerSam James <sam@gentoo.org>2025-03-21 19:12:55 +0000
commitcaea6d9760e3f9a67d6e9205ae6c176548b19927 (patch)
tree741547d703cb90a078d8b5684ec1e437cb23457b /dev-lang/rust/rust-9999.ebuild
parente4fc94000327c47e402be938cc240609fda31a3c (diff)
downloadgentoo-caea6d9760e3f9a67d6e9205ae6c176548b19927.tar.gz
gentoo-caea6d9760e3f9a67d6e9205ae6c176548b19927.tar.bz2
gentoo-caea6d9760e3f9a67d6e9205ae6c176548b19927.zip
dev-lang/rust: fix build using clang but not lld
use-lld appeared first in commit bfba6ef328bbba327cae8918e795c11b89217672 refactored in commit befd1eb4ec78e19f0c8628fa75241ea3ed6ec792 Closes: https://bugs.gentoo.org/948027 Signed-off-by: Z. Liu <zhixu.liu@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/40772 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/rust/rust-9999.ebuild')
-rw-r--r--dev-lang/rust/rust-9999.ebuild8
1 files changed, 8 insertions, 0 deletions
diff --git a/dev-lang/rust/rust-9999.ebuild b/dev-lang/rust/rust-9999.ebuild
index d7dd9d8d660c..72e640905646 100644
--- a/dev-lang/rust/rust-9999.ebuild
+++ b/dev-lang/rust/rust-9999.ebuild
@@ -94,6 +94,7 @@ BDEPEND="${PYTHON_DEPS}
>=sys-devel/gcc-4.7[cxx]
>=llvm-core/clang-3.5
)
+ lto? ( $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}') )
!system-llvm? (
>=dev-build/cmake-3.13.4
app-alternatives/ninja
@@ -306,6 +307,10 @@ src_prepare() {
fi
fi
+ if use lto && tc-is-clang && ! tc-ld-is-lld; then
+ export RUSTFLAGS+=" -C link-arg=-fuse-ld=lld"
+ fi
+
default
}
@@ -474,6 +479,9 @@ src_configure() {
dist-src = false
remap-debuginfo = true
lld = $(usex system-llvm false $(toml_usex wasm))
+ $(if use lto && tc-is-clang ; then
+ echo "use-lld = true"
+ fi)
# only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
# https://github.com/rust-lang/rust/issues/74976
# https://github.com/rust-lang/rust/issues/76526