commit: dc7aaf972ca0e70c9140fe43a0f9d7ac235190d8 Author: Joonas Niilola <juippis <AT> gentoo <DOT> org> AuthorDate: Mon Jun 16 05:32:59 2025 +0000 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> CommitDate: Mon Jun 16 05:32:59 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc7aaf97
dev-lang/rust: fix building '+wasm' on clang/lld system on 1.87.0 - sync changes from 1.86.0. Bug: https://bugs.gentoo.org/953956 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> ...bgo-953956-fix-hardcoded-gnu-linker-flags.patch | 29 ++++++++++++++++++++++ dev-lang/rust/rust-1.87.0-r1.ebuild | 2 ++ 2 files changed, 31 insertions(+) diff --git a/dev-lang/rust/files/rust-1.87.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch b/dev-lang/rust/files/rust-1.87.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch new file mode 100644 index 000000000000..37d054222cda --- /dev/null +++ b/dev-lang/rust/files/rust-1.87.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch @@ -0,0 +1,29 @@ +From 76e13020767e7ff783284b5bcf7a7509259ceb51 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= <[email protected]> +Date: Fri, 4 Apr 2025 18:29:20 +0200 +Subject: [PATCH] Use target-agnostic LLD flags in bootstrap for use-lld + +--- + src/bootstrap/src/utils/helpers.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/bootstrap/src/utils/helpers.rs b/src/bootstrap/src/utils/helpers.rs +index f8e4d4e04717d..78dcdcbd1874a 100644 +--- a/src/bootstrap/src/utils/helpers.rs ++++ b/src/bootstrap/src/utils/helpers.rs +@@ -474,13 +474,13 @@ pub fn linker_flags( + if stage == 0 && target.is_windows() { + args.push("-Clink-arg=-fuse-ld=lld".to_string()); + } else { +- args.push("-Clinker-flavor=gnu-lld-cc".to_string()); ++ args.push("-Zlinker-features=+lld".to_string()); + } + // FIXME(kobzol): remove this flag once MCP510 gets stabilized + args.push("-Zunstable-options".to_string()); + } + LldMode::SelfContained => { +- args.push("-Clinker-flavor=gnu-lld-cc".to_string()); ++ args.push("-Zlinker-features=+lld".to_string()); + args.push("-Clink-self-contained=+linker".to_string()); + // FIXME(kobzol): remove this flag once MCP510 gets stabilized + args.push("-Zunstable-options".to_string()); diff --git a/dev-lang/rust/rust-1.87.0-r1.ebuild b/dev-lang/rust/rust-1.87.0-r1.ebuild index 206dda02987b..b5031df1745f 100644 --- a/dev-lang/rust/rust-1.87.0-r1.ebuild +++ b/dev-lang/rust/rust-1.87.0-r1.ebuild @@ -317,6 +317,8 @@ src_prepare() { fi default + + eapply "${FILESDIR}"/rust-1.87.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch } src_configure() {
