commit:     fec7440bc405a099f3e5e0efef019f1773760db7
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Wed Jun 18 13:13:00 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 22 09:46:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fec7440b

dev-lang/micropython: fix build issue using mold

remove link option "--cref" because mold doesn't support

not all files were patched, but the compilation & tests succeeded.

Closes: https://bugs.gentoo.org/937354
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42654
Closes: https://github.com/gentoo/gentoo/pull/42654
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/micropython/micropython-1.23.0.ebuild | 11 ++++++++++-
 dev-lang/micropython/micropython-1.25.0.ebuild |  8 ++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/dev-lang/micropython/micropython-1.23.0.ebuild 
b/dev-lang/micropython/micropython-1.23.0.ebuild
index a35b07da8c2f..6d07e5dbd032 100644
--- a/dev-lang/micropython/micropython-1.23.0.ebuild
+++ b/dev-lang/micropython/micropython-1.23.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -26,6 +26,15 @@ PATCHES=(
 
 src_prepare() {
        default
+
+       tc-ld-is-mold && {
+               # mold doesn't support --cref, bug #937354
+               find . -name Makefile -exec sed -r \
+                       -e 's:map,--cref\s:map :g' \
+                       -e 's:\s(-Wl,)?--cref(\s|$): :g' \
+                       -i {} + || die
+       }
+
        cd ports/unix || die
 
        # 1) don't die on compiler warning

diff --git a/dev-lang/micropython/micropython-1.25.0.ebuild 
b/dev-lang/micropython/micropython-1.25.0.ebuild
index 21c4593a7694..ad0c5daea652 100644
--- a/dev-lang/micropython/micropython-1.25.0.ebuild
+++ b/dev-lang/micropython/micropython-1.25.0.ebuild
@@ -27,6 +27,14 @@ BDEPEND="
 src_prepare() {
        default
 
+       tc-ld-is-mold && {
+               # mold doesn't support --cref, bug #937354
+               find . -name Makefile -exec sed -r \
+                       -e 's:map,--cref\s:map :g' \
+                       -e 's:\s(-Wl,)?--cref(\s|$): :g' \
+                       -i {} + || die
+       }
+
        micropython_skip_test() {
                local file
                for file in "$@" ; do

Reply via email to