From: "Benda XU" <heroxbd@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
Date: Fri, 8 Jul 2022 17:40:37 +0000 (UTC) [thread overview]
Message-ID: <1657302006.7dac65ea4155fa1f5a21bdd46dd9793d21911e0e.heroxbd@gentoo> (raw)
commit: 7dac65ea4155fa1f5a21bdd46dd9793d21911e0e
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Mon Jun 27 13:12:30 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Jul 8 17:40:06 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dac65ea
dev-util/hip: add missing BDEPEND for USE=profile
Also fix ld warnings by patch out unecessary ldflag added by hipcc.pl
Closes: https://github.com/gentoo/gentoo/pull/26090
Closes: https://bugs.gentoo.org/843263
Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/hip/files/hip-5.0.2-correct-ldflag.patch | 18 ++++++++++++++++++
dev-util/hip/hip-5.0.2-r2.ebuild | 17 ++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/dev-util/hip/files/hip-5.0.2-correct-ldflag.patch b/dev-util/hip/files/hip-5.0.2-correct-ldflag.patch
new file mode 100644
index 000000000000..81d1bc3b8552
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.2-correct-ldflag.patch
@@ -0,0 +1,18 @@
+This removes ldflag -L"/usr/lib" and -Wl,-rpath=/usr/lib:/usr/lib which
+causes `ld: skipping incompatible /usr/lib/libm.so when searching for -lm`
+Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
+===================================================================
+--- HIP-rocm-5.1.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.1.3/bin/hipcc.pl
+@@ -703,9 +703,9 @@ if ($HIP_PLATFORM eq "amd") {
+
+ if (not $isWindows and not $compileOnly) {
+ if ($linkType eq 0) {
+- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
++ $toolArgs = " -lamdhip64 -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
+ } else {
+- $toolArgs = " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 " . ${toolArgs};
++ $toolArgs = " -Wl,--enable-new-dtags -lamdhip64 " . ${toolArgs};
+ }
+ # To support __fp16 and _Float16, explicitly link with compiler-rt
+ $HIP_CLANG_BUILTIN_LIB="/opt/gentoo/opt/gentoo/usr/lib/llvm/14/bin/../../../../lib/clang/14.0.6/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
diff --git a/dev-util/hip/hip-5.0.2-r2.ebuild b/dev-util/hip/hip-5.0.2-r2.ebuild
index 223386227084..fd069acfe4b4 100644
--- a/dev-util/hip/hip-5.0.2-r2.ebuild
+++ b/dev-util/hip/hip-5.0.2-r2.ebuild
@@ -2,7 +2,10 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-inherit cmake prefix
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake prefix python-any-r1
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
@@ -29,6 +32,10 @@ DEPEND="
RDEPEND="${DEPEND}
dev-perl/URI-Encode
dev-libs/roct-thunk-interface:${SLOT}"
+BDEPEND="profile? ( $(python_gen_any_dep '
+ dev-python/CppHeaderParser[${PYTHON_USEDEP}]
+ ') )
+"
PATCHES=(
"${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
@@ -38,6 +45,12 @@ PATCHES=(
"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
)
+python_check_deps() {
+ if use profile; then
+ has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]"
+ fi
+}
+
S="${WORKDIR}/hipamd-rocm-${PV}"
HIP_S="${WORKDIR}"/HIP-rocm-${PV}
OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
@@ -65,11 +78,13 @@ src_prepare() {
sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
cd ${HIP_S} || die
+ eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
-e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \
-e "/rpath/s,--rpath=[^ ]*,," \
-i bin/hipcc.pl || die
next reply other threads:[~2022-07-08 17:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 17:40 Benda XU [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-13 8:38 [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/ Sam James
2024-06-26 9:21 Sam James
2023-12-14 15:02 Benda XU
2023-12-14 15:02 Benda XU
2023-10-09 16:27 罗百科
2023-04-05 16:10 Benda XU
2023-03-02 17:46 罗百科
2023-02-20 4:33 Sam James
2023-02-10 4:26 Sam James
2023-02-01 9:53 Andreas Sturmlechner
2023-01-31 13:32 Benda XU
2023-01-31 13:32 Benda XU
2023-01-21 3:32 Sam James
2022-12-19 14:00 Andreas Sturmlechner
2022-11-19 11:50 Benda XU
2022-08-06 14:23 Benda XU
2022-03-22 4:09 Benda XU
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1657302006.7dac65ea4155fa1f5a21bdd46dd9793d21911e0e.heroxbd@gentoo \
--to=heroxbd@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox