commit:     9fb562001ae0cf172c89dfa4561c6af6c996a406
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Mon Jan  1 18:05:03 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan  6 07:20:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fb56200

dev-util/hip: fix linker error for ld.lld: error: version script assignment 
issue

Closes: https://bugs.gentoo.org/921171
See also: https://github.com/gentoo/gentoo/pull/29097
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34595
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/hip/hip-6.0.0.ebuild | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/dev-util/hip/hip-6.0.0.ebuild b/dev-util/hip/hip-6.0.0.ebuild
index 9f8f62ca11ad..40efa9317ab4 100644
--- a/dev-util/hip/hip-6.0.0.ebuild
+++ b/dev-util/hip/hip-6.0.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -81,6 +81,16 @@ src_prepare() {
 src_configure() {
        use debug && CMAKE_BUILD_TYPE="Debug"
 
+       # Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
+       # See also: https://github.com/gentoo/gentoo/pull/29097
+
+       # ideally we want !tc-ld-is-bfd for best future-proofing, but it needs
+       # https://github.com/gentoo/gentoo/pull/28355
+       # mold needs this too but right now tc-ld-is-mold is also not available
+       if tc-ld-is-lld; then
+               append-ldflags -Wl,--undefined-version
+       fi
+
        local mycmakeargs=(
                -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
                -DCMAKE_BUILD_TYPE=${buildtype}

Reply via email to