diff options
Diffstat (limited to 'dev-util/hipcc')
-rw-r--r-- | dev-util/hipcc/Manifest | 5 | ||||
-rw-r--r-- | dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch | 13 | ||||
-rw-r--r-- | dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch | 42 | ||||
-rw-r--r-- | dev-util/hipcc/hipcc-5.7.1-r1.ebuild | 27 | ||||
-rw-r--r-- | dev-util/hipcc/hipcc-5.7.1-r2.ebuild | 46 | ||||
-rw-r--r-- | dev-util/hipcc/hipcc-5.7.1.ebuild | 21 |
6 files changed, 104 insertions, 50 deletions
diff --git a/dev-util/hipcc/Manifest b/dev-util/hipcc/Manifest index f68dee6a2c91..ca9ea27161d8 100644 --- a/dev-util/hipcc/Manifest +++ b/dev-util/hipcc/Manifest @@ -1,4 +1,5 @@ +AUX hipcc-5.7.1-fno-stack-protector.patch 499 BLAKE2B d848b79ad2fd542bc6e6595ebc7dbd240b23aa2903aae31a0583b7beba032d8f4999142b932e9a443415bdb7ae4fe06f9e7da607c402109e3b887fef741d460f SHA512 a115cc8c9779cd318e7806d78a8aa99f03596258f8d3b105231dd6b1f9d3168687c305d1ec1c95902f841bb18570f943d3a655a03504f19a6f6ca7419d9272fd +AUX hipcc-5.7.1-hipcc-hip-version.patch 2245 BLAKE2B 85e41db593706478e92966ee2ee33e1e8c8309251446f14192083a81e35f43be5dfa23337abc8371147b59c9399be79f9461cadf7ba0e025f1355d6c9836d68e SHA512 2cbfdeb9361b38a32ef52dec0c899c7cadc7220a5213fd6e9670c8a9ea6690e80e956d236e0de893bc4fe19117466659bdfdb2e16e720011b7480bc2e8bee458 DIST hipcc-5.7.1.tar.gz 36589 BLAKE2B a8ae6bd9f0f985d78119223b67b5b35b8d1ee38edb7e43c1e77752d203fe2c8b669b3bcff0cec661054d8cb24f799e7784a49eb0664bdd1dc2bf024ce026c175 SHA512 2d232c8dd4a47de6e0cff9d37b4e63a26cb1809ef2ff3a119c15e992cae96ffc2f4d8c1ddffd8732dea3a3d589a93e177f424a6174f982908aa50904e265432a -EBUILD hipcc-5.7.1-r1.ebuild 660 BLAKE2B 69b76125c382e37f48d618319650f5e2de52622fc41b44d6e20a32fa8accbcaa3bc02ad58a416e574502ac03f6340e5deabe527fc02f2b7a388ced2aeaa844cd SHA512 22f0a81f4e002257b2e1a9ad66144ab1b9adbcb0f9e55cfb3b69a29e11bbd854b802f8fd3085c175f64df58019c53aea9fa83dc93deb936a09d638cfe0291923 -EBUILD hipcc-5.7.1.ebuild 514 BLAKE2B 85396696876960c47075dcf519c27d3dcb57c4154ba359a47222cb171c60a8a2532640d4f4e49e6f8d29a341faefa194ee28dd3075f867fee84d2880dbb63f0a SHA512 3fe23c89a253bb064417cee9f5766f7aebab482272245b06fe099fceacd59d79eb93102082cd22a1dab0b536ed24981e0542660628ea09479084b575907a1036 +EBUILD hipcc-5.7.1-r2.ebuild 1102 BLAKE2B c89329c17258f59bf31d6039419df045dd8e2c097a4560bcb9bb511ffd3b5d032f79db1de3e9b916a6d459ad280efa8745db51a171130d31e89d5bd3988c8615 SHA512 02323828028ae2ea26010e7c1d7ceb75100275ed019d9a50e07a2c8df19602d45afc21f50f6216e713df383dd37431946f9dc69daddf3c5cd1134e53a748fe92 MISC metadata.xml 845 BLAKE2B 108a9ee40f02d5e190f4d1ee11eea32aaec844c63811265d52046bdb266f6cddfb1774419feace41aaa2bacfd01581847f655aa5fc49536968c54e7f023d49ae SHA512 2b7bbe1205b4a07b81e6c0f4cc2c224a573a03004ce808b4d1ef51ea1b0bec770545b7c46530a1b18222cd67854f790ae44695dd39ef2201d7f3e3ea3ada904f 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/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-r1.ebuild b/dev-util/hipcc/hipcc-5.7.1-r1.ebuild deleted file mode 100644 index 78f9a80f3561..000000000000 --- a/dev-util/hipcc/hipcc-5.7.1-r1.ebuild +++ /dev/null @@ -1,27 +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" - -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 -} diff --git a/dev-util/hipcc/hipcc-5.7.1-r2.ebuild b/dev-util/hipcc/hipcc-5.7.1-r2.ebuild new file mode 100644 index 000000000000..180354c8673c --- /dev/null +++ b/dev-util/hipcc/hipcc-5.7.1-r2.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake llvm + +LLVM_MAX_SLOT=17 + +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" + +PATCHES=( + "${FILESDIR}/${PN}-5.7.1-fno-stack-protector.patch" + "${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch" +) + +src_prepare() { + 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" |