commit:     9dd4853cd6c55934e3b13a019be3d62fe5c6d1ea
Author:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 10 17:18:07 2025 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Tue Jun 10 17:18:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9dd4853c

dev-lang/rust: fix building '+wasm' on clang/lld system on 1.86.0

Closes: https://bugs.gentoo.org/953956
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 ...372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch | 18 ++++++++++++++++++
 dev-lang/rust/rust-1.86.0-r2.ebuild                    |  2 ++
 2 files changed, 20 insertions(+)

diff --git 
a/dev-lang/rust/files/rust-1.86.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch
 
b/dev-lang/rust/files/rust-1.86.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch
new file mode 100644
index 000000000000..11d7738f2ee1
--- /dev/null
+++ 
b/dev-lang/rust/files/rust-1.86.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch
@@ -0,0 +1,18 @@
+diff '--color=auto' -Nuar 
rustc-1.86.0-src.orig/src/bootstrap/src/utils/helpers.rs 
rustc-1.86.0-src/src/bootstrap/src/utils/helpers.rs
+--- rustc-1.86.0-src.orig/src/bootstrap/src/utils/helpers.rs   2025-03-31 
22:37:24.000000000 +0100
++++ rustc-1.86.0-src/src/bootstrap/src/utils/helpers.rs        2025-04-17 
12:31:37.651607535 +0100
+@@ -451,12 +451,12 @@
+     if !builder.is_lld_direct_linker(target) && 
builder.config.lld_mode.is_used() {
+         match builder.config.lld_mode {
+             LldMode::External => {
+-                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.86.0-r2.ebuild 
b/dev-lang/rust/rust-1.86.0-r2.ebuild
index 9ca6ee0b6b79..e15141928083 100644
--- a/dev-lang/rust/rust-1.86.0-r2.ebuild
+++ b/dev-lang/rust/rust-1.86.0-r2.ebuild
@@ -316,6 +316,8 @@ src_prepare() {
        fi
 
        default
+
+       eapply 
"${FILESDIR}"/rust-1.86.0-issue-139372-bgo-953956-fix-hardcoded-gnu-linker-flags.patch
 }
 
 src_configure() {

Reply via email to