* [gentoo-commits] repo/gentoo:master commit in: dev-util/hipcc/, dev-util/hipcc/files/
@ 2023-11-19 2:18 Benda XU
0 siblings, 0 replies; 2+ messages in thread
From: Benda XU @ 2023-11-19 2:18 UTC (permalink / raw
To: gentoo-commits
commit: 81bb39c7edf4c0b137a980a8b3ec8f817491013d
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sun Oct 22 12:56:19 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Nov 19 02:18:21 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81bb39c7
dev-util/hipcc: passing --hip-version to clang for proper include
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../files/hipcc-5.7.1-hipcc-hip-version.patch | 42 ++++++++++++++++++++++
dev-util/hipcc/hipcc-5.7.1-r2.ebuild | 1 +
2 files changed, 43 insertions(+)
diff --git a/dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch b/dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch
new file mode 100644
index 000000000000..fa00d44d912e
--- /dev/null
+++ b/dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch
@@ -0,0 +1,42 @@
+Edit from:
+https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/759b0773bd848ff9471fa8cdecd9ee21010bc29c/debian/patches/0013-hipcc-hip-version.patch
+`--hip-version` is required for correclty including __clang_hip_runtime_wrapper.h
+=================================================================================
+Description: enforce --hip-version option within hipcc call.
+ This change is needed since the normal mechanism in ROCm relies on
+ reading a .hipVersion hidden configuration file which has no proper
+ equivalent in a FHS compliant tree, as of ROCm 5.0.
+Author: Cordell Bloor <cgmb-deb@slerp.xyz>
+Bug: https://github.com/ROCm-Developer-Tools/HIP/pull/2937
+Forwarded: not-needed
+Reviewed-by: Étienne Mollier <emollier@debian.org>
+Last-Update: 2022-07-04
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: HIP/bin/hipcc.pl
+===================================================================
+--- HIP.orig/bin/hipcc.pl
++++ HIP/bin/hipcc.pl
+@@ -121,6 +121,9 @@ $HIP_PATH = $hipvars::HIP_PATH;
+ $ROCM_PATH = $hipvars::ROCM_PATH;
+ $HIP_VERSION = $hipvars::HIP_VERSION;
+ $HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;
++$HIP_VERSION_MAJOR = $hipvars::HIP_VERSION_MAJOR;
++$HIP_VERSION_MINOR = $hipvars::HIP_VERSION_MINOR;
++$HIP_VERSION_PATCH = $hipvars::HIP_VERSION_PATCH;
+
+ if ($HIP_PLATFORM eq "amd") {
+ $HIP_INCLUDE_PATH = "$HIP_ROCCLR_HOME/include";
+@@ -188,6 +191,12 @@ if ($HIP_PLATFORM eq "amd") {
+ ## Allow __fp16 as function parameter and return type.
+ $HIPCXXFLAGS .= " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1";
+ }
++
++ # Gentoo: there is no FHS compliant location for .hipVersion where clang will still be
++ # able to find it, so .hipVersion has been omitted and the hip version is passed explicitly
++ $HIPCXXFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
++ $HIPCFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
++ $HIPLDFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
+ } elsif ($HIP_PLATFORM eq "nvidia") {
+ $CUDA_PATH=$ENV{'CUDA_PATH'} // '/usr/local/cuda';
+ $HIP_INCLUDE_PATH = "$HIP_PATH/include";
diff --git a/dev-util/hipcc/hipcc-5.7.1-r2.ebuild b/dev-util/hipcc/hipcc-5.7.1-r2.ebuild
index d711d8956ac0..180354c8673c 100644
--- a/dev-util/hipcc/hipcc-5.7.1-r2.ebuild
+++ b/dev-util/hipcc/hipcc-5.7.1-r2.ebuild
@@ -24,6 +24,7 @@ RDEPEND="!<dev-util/hip-5.7"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-fno-stack-protector.patch"
+ "${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch"
)
src_prepare() {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hipcc/, dev-util/hipcc/files/
@ 2023-11-19 2:18 Benda XU
0 siblings, 0 replies; 2+ messages in thread
From: Benda XU @ 2023-11-19 2:18 UTC (permalink / raw
To: gentoo-commits
commit: 6992e6ff39664c798459db3f93e048a06095adf6
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Wed Oct 18 18:37:09 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Nov 19 02:18:15 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6992e6ff
dev-util/hipcc-5.7.1: fix compilation issues
- Restore the patch for adding -fno-stack-protector
- Better handling of clang path using llvm.eclass
- Fix the device lib path parsed to clang
- QA: remove files installed to wrong location
Bug: https://bugs.gentoo.org/890377
Bug: https://github.com/gentoo/gentoo/pull/33400
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/33845
.../files/hipcc-5.7.1-fno-stack-protector.patch | 13 ++++++++++++
...hipcc-5.7.1-r1.ebuild => hipcc-5.7.1-r2.ebuild} | 24 +++++++++++++++++++---
dev-util/hipcc/hipcc-5.7.1.ebuild | 21 -------------------
3 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch b/dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch
new file mode 100644
index 000000000000..c46420265005
--- /dev/null
+++ b/dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch
@@ -0,0 +1,13 @@
+Related bug: https://bugs.gentoo.org/890377
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -552,6 +552,9 @@ if ($buildDeps and $HIP_PLATFORM eq 'amd') {
+ # pass-through CPP mode.
+
+ if ($HIP_PLATFORM eq "amd") {
++ # Append -fno-stack-protector due to stack protection for HIP is not supported
++ $HIPCXXFLAGS .= " -fno-stack-protector";
++ $HIPCFLAGS .= " -fno-stack-protector";
+ # Set default optimization level to -O3 for hip-clang.
+ if ($optArg eq "") {
+ $HIPCXXFLAGS .= " -O3";
diff --git a/dev-util/hipcc/hipcc-5.7.1-r1.ebuild b/dev-util/hipcc/hipcc-5.7.1-r2.ebuild
similarity index 51%
rename from dev-util/hipcc/hipcc-5.7.1-r1.ebuild
rename to dev-util/hipcc/hipcc-5.7.1-r2.ebuild
index 78f9a80f3561..d711d8956ac0 100644
--- a/dev-util/hipcc/hipcc-5.7.1-r1.ebuild
+++ b/dev-util/hipcc/hipcc-5.7.1-r2.ebuild
@@ -3,7 +3,9 @@
EAPI=8
-inherit cmake
+inherit cmake llvm
+
+LLVM_MAX_SLOT=17
DESCRIPTION="Radeon Open Compute hipcc"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipcc"
@@ -20,8 +22,24 @@ S=${WORKDIR}/HIPCC-rocm-${PV}
RDEPEND="!<dev-util/hip-5.7"
+PATCHES=(
+ "${FILESDIR}/${PN}-5.7.1-fno-stack-protector.patch"
+)
+
src_prepare() {
- # hardcoded paths are wrong
- sed -i -e 's~$ROCM_PATH/llvm/bin~/usr/lib/llvm/17/bin~' bin/hipvars.pm || die
cmake_src_prepare
+
+ sed -e "s:\$ROCM_PATH/llvm/bin:$(get_llvm_prefix ${LLVM_MAX_SLOT})/bin:" \
+ -i bin/hipvars.pm || die
+
+ sed -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
+ -e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
+ -i bin/hipcc.pl || die
+}
+
+src_install() {
+ cmake_src_install
+ # rm unwanted copy
+ rm -rf "${ED}/usr/hip" || die
}
diff --git a/dev-util/hipcc/hipcc-5.7.1.ebuild b/dev-util/hipcc/hipcc-5.7.1.ebuild
deleted file mode 100644
index 71fbdc1e5def..000000000000
--- a/dev-util/hipcc/hipcc-5.7.1.ebuild
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute hipcc"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipcc"
-
-KEYWORDS="~amd64"
-SRC_URI="https://github.com/ROCm-Developer-Tools/hipcc/archive/refs/tags/rocm-${PV}.tar.gz -> hipcc-${PV}.tar.gz"
-
-LICENSE="Apache-2.0 MIT"
-SLOT="0/$(ver_cut 1-2)"
-IUSE="debug test"
-RESTRICT="!test? ( test )"
-
-S=${WORKDIR}/HIPCC-rocm-${PV}
-
-RDEPEND="!<dev-util/hip-5.7"
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-19 2:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-19 2:18 [gentoo-commits] repo/gentoo:master commit in: dev-util/hipcc/, dev-util/hipcc/files/ Benda XU
-- strict thread matches above, loose matches on Subject: below --
2023-11-19 2:18 Benda XU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox