summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilfried Holzke <gentoo@holzke.net>2021-03-24 16:39:54 +0100
committerCraig Andrews <candrews@gentoo.org>2021-03-25 13:55:56 -0400
commitcb4f74b84500dafa0e51100870b028c3d9bf63c7 (patch)
tree202fcca61de830bdeb12b02b6a73d9a0e3c91813 /sys-devel/llvm-roc
parentdev-util/rocm-cmake: Version bump to 4.1.0 (diff)
downloadgentoo-cb4f74b84500dafa0e51100870b028c3d9bf63c7.tar.gz
gentoo-cb4f74b84500dafa0e51100870b028c3d9bf63c7.tar.bz2
gentoo-cb4f74b84500dafa0e51100870b028c3d9bf63c7.zip
sys-devel/llvm-roc: Version bump to 4.1.0
Signed-off-by: Wilfried Holzke <gentoo@holzke.net> Package-Manager: Portage-3.0.13, Repoman-3.0.2 Closes: https://github.com/gentoo/gentoo/pull/20103 Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'sys-devel/llvm-roc')
-rw-r--r--sys-devel/llvm-roc/Manifest1
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild93
2 files changed, 94 insertions, 0 deletions
diff --git a/sys-devel/llvm-roc/Manifest b/sys-devel/llvm-roc/Manifest
index 352199eee196..d69ea4e31ba2 100644
--- a/sys-devel/llvm-roc/Manifest
+++ b/sys-devel/llvm-roc/Manifest
@@ -4,3 +4,4 @@ DIST llvm-rocm-ocl-3.8.0.tar.gz 117004300 BLAKE2B 13c3213f0fb951fb9d574e8f6d76bb
DIST llvm-rocm-ocl-3.9.0.tar.gz 123591368 BLAKE2B 54b44d705e7704921df1914bac6dc1da8e420f9383efb698a9cf6a339b653d71cad29aa077a9e24d6764ca81fb8dc55fa70abb0cfac004d40f7d811e20ec9945 SHA512 3404390506b33c1de1d05980fafb219692985f38b52d852e9a47ab94e57228caa25ccd0d0d69da656281de32c75e001f60cb9f22453e70fea7b39d065d4333af
DIST llvm-rocm-ocl-4.0.0.tar.gz 123595983 BLAKE2B 69dd47a50a53cf7d8168f872778bcda0e028907c2341b165f40152bdf03b668ee6c209dc60fa1018dde2a946d891f15eb92a38cfbc12bb5798dd132c1ce79bf1 SHA512 2ac3d643e0bee72239089003cd2889711a7cd58dc588467fb0ca0a50bec264fda992aa2e3352d5210011a9dc1eea4dd9eacdc7d0c313cd69c7b491df126a4e4e
DIST llvm-rocm-ocl-4.0.1.tar.gz 123608276 BLAKE2B dd5a4d6bc198c7fb6fdc2514cd8c4533a2df6ded7a574c9b4762cda3cb65498a464a0e78427db94db05b468a29ce78d3d8131ac7c6e42953fc503896732474e3 SHA512 d23dceaee2badf46cda27aa725bce5b82bab2fba7d1c2220fedb4795eee455de5077b4ff7299ecd6850eeb0bbdb131ea12a699357f373aef818758d845550f04
+DIST llvm-rocm-ocl-4.1.0.tar.gz 128913932 BLAKE2B 15a041ec7b9fec91e409c8ab98ff88f2d15ce58822aa8a77a26ff21416378a4a77a5904fce4e26c5447653da4ec2dbbb5bfec4ae70c72e8e64b2a5f5986ffb92 SHA512 8576e5a43754a9587613f166dc6cad18890812f07bfa55e563ab3de150b6f01ae1b5515aaaf4eef238a7f79e87890533ce791ef07528e4557ea8290c2642ebd3
diff --git a/sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild b/sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild
new file mode 100644
index 000000000000..eb7e40df837d
--- /dev/null
+++ b/sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Radeon Open Compute llvm,lld,clang"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
+SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
+
+LICENSE="UoI-NCSA rc BSD public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug +runtime"
+
+RDEPEND="virtual/cblas
+ dev-libs/libxml2
+ sys-libs/zlib
+ sys-libs/ncurses:="
+DEPEND="${RDEPEND}"
+PDEPEND="dev-libs/rocr-runtime"
+
+S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
+)
+
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+src_prepare() {
+ cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
+ eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
+ eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
+ eapply "${FILESDIR}/${PN}-4.0.0-hip-location.patch"
+
+ if [[ -n ${EPREFIX} ]]; then
+ pushd "${S}"/../clang >/dev/null || die
+ sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
+ eend $?
+ ebegin "Use ${EPREFIX} as default sysroot"
+ cd lib/Driver/ToolChains >/dev/null || die
+ ebegin "Use dynamic linker from ${EPREFIX}"
+ sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
+ eend $?
+
+ ebegin "Remove --sysroot call on ld for native toolchain"
+ sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
+ eend $?
+ popd >/dev/null || die
+ fi
+
+ # handled by sysroot, don't prefixify here.
+ sed -e 's:/opt/rocm:/usr/lib/hip:' \
+ -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
+
+ eapply_user
+ cmake_src_prepare
+}
+
+src_configure() {
+ PROJECTS="clang;lld"
+
+ if usex runtime; then
+ PROJECTS+=";compiler-rt"
+ fi
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
+ -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
+ -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
+ -DLLVM_BUILD_DOCS=NO
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=NO
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ -DLLVM_VERSION_SUFFIX=roc
+ -DOCAMLFIND=NO
+ )
+
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ cat > "99${PN}" <<-EOF
+ LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
+ EOF
+ doenvd "99${PN}"
+}