summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2023-09-03 06:16:20 +0000
committerPatrick Lauer <patrick@gentoo.org>2023-09-03 06:31:23 +0000
commit2406819f625713884dfba25c3fdbfe1f77106cf4 (patch)
tree393d7398246cc4b2df12583874d4a0bba717733c /dev-libs/rocm-comgr
parentdev-libs/rocr-runtime: add 5.5.1 (diff)
downloadgentoo-2406819f625713884dfba25c3fdbfe1f77106cf4.tar.gz
gentoo-2406819f625713884dfba25c3fdbfe1f77106cf4.tar.bz2
gentoo-2406819f625713884dfba25c3fdbfe1f77106cf4.zip
dev-libs/rocm-comgr: add 5.5.1
Signed-off-by: Patrick Lauer <patrick@gentoo.org>
Diffstat (limited to 'dev-libs/rocm-comgr')
-rw-r--r--dev-libs/rocm-comgr/Manifest1
-rw-r--r--dev-libs/rocm-comgr/files/9999-include.patch10
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-fix-tests.patch17
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-lld-include.patch22
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-nullopt.patch23
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-opt_mrelax.patch23
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-subtargetfeatures.patch26
-rw-r--r--dev-libs/rocm-comgr/rocm-comgr-5.5.1.ebuild64
8 files changed, 186 insertions, 0 deletions
diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest
index 987ecc12644a..ffbc20898d35 100644
--- a/dev-libs/rocm-comgr/Manifest
+++ b/dev-libs/rocm-comgr/Manifest
@@ -1,3 +1,4 @@
DIST rocm-comgr-5.1.3.tar.gz 117155 BLAKE2B 40e415c4c7ae3e709dd50981299291f0fc1133f35310b4c86a86847d3bce5fd7685a3f4480f8f156873ca922921c1d4e1cb620fd33bd5cdc87f155af839f2bbe SHA512 5927250f5e03c32b7f270a1dbfe5221d349dfe32aba34143040da53d4e7eb83faa3073a43edabcff13e1fc977bc17088404523f2ab2ea95e207d2c00beb4249b
DIST rocm-comgr-5.3.3.tar.gz 120414 BLAKE2B 29b9d466d74ef94165a2b9bea35eac4616f6b2fc529cdac3c830ee7dc08f219cb9e5d4f081658881c76633f12eaebb74d1a2ea30a76652231b8ee516f9988db1 SHA512 ba7b1ef214e3624168e438ed7fd94291a07508fe89d178c0b158bf22e0998d5a8e4d8f0a7f08f05ac108ef65f725db5764fd66353a85bc25000e572a4fdcb61f
DIST rocm-comgr-5.4.3.tar.gz 120461 BLAKE2B c4eb79dd5a72a2b18e16841fc8cb9a3a33efb0c7b04a7585df9672d682bba6fa826ab8b37dba5febca3b8c5ee5aca30d8546e1fa69e77671e5c750e2a8c1f12f SHA512 1a25af99a0166d70ca6dc5df5a667068eaf583dccd74bbb18a2a5de3c1b769e0c1eb9a0c539e0cd88bc50bbbe53214a1d1b23fbdfd6fc5b6507c44da259815c4
+DIST rocm-comgr-5.5.1.tar.gz 127475 BLAKE2B dbcb6729b27c0b4a4be37f5e462d96b10c15a6a3b540a81a74a648fc45dc727ea5706db1a0f4583a31ac4cb5c9f0d9f4e258fa5ac792b327f4cb1dfe6d585937 SHA512 09174ef2ad21f62b197e439bb5b04a365233c360c57cc2ccf0ea3d53edfa8880dff4f127c6d6c1d430b63b6f7ea666705b14cadc2bccb89c0fefed943b0cf1c7
diff --git a/dev-libs/rocm-comgr/files/9999-include.patch b/dev-libs/rocm-comgr/files/9999-include.patch
new file mode 100644
index 000000000000..58770c819967
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/9999-include.patch
@@ -0,0 +1,10 @@
+--- comgr/src/comgr-env.h.orig 2023-06-07 02:39:28.039489253 +0200
++++ comgr/src/comgr-env.h 2023-06-07 02:39:58.502264137 +0200
+@@ -38,6 +38,7 @@
+
+ #include "llvm/ADT/Optional.h"
+ #include "llvm/ADT/StringRef.h"
++#include "llvm/ADT/None.h"
+
+ namespace COMGR {
+ namespace env {
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-fix-tests.patch b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-fix-tests.patch
new file mode 100644
index 000000000000..9fd14df196a2
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-fix-tests.patch
@@ -0,0 +1,17 @@
+Vanilla LLVM does not support calling AMDGPU_KERNEL across different sources/bitcodes.
+Without this patch https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/issues/45 occurs.
+Reference: https://github.com/llvm/llvm-project/issues/60313
+===================================================================
+--- comgr.orig/test/source/source1.cl
++++ comgr/test/source/source1.cl
+@@ -35,7 +35,9 @@
+
+ #include "include-a.h"
+
++void kernel source3(__global int *j) { *j = FOO; }
++
+ void kernel source1(__global int *j) {
+ *j += 2;
+- source2(j);
++ source3(j);
+ }
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-lld-include.patch b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-lld-include.patch
new file mode 100644
index 000000000000..96df9291eb86
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-lld-include.patch
@@ -0,0 +1,22 @@
+From 271fddf65f43675e675f0cb4e9aaa3d27d34c58a Mon Sep 17 00:00:00 2001
+From: Ron Lieberman <ron.lieberman@amd.com>
+Date: Thu, 29 Dec 2022 05:17:41 -0600
+Subject: [PATCH] [llvm merge] add include of lld/Common/CommonLinkerContext.h
+
+Change-Id: I5767b4c1e683e9df9146804ba23ef3c0c0b6c07a
+---
+ lib/comgr/src/comgr-compiler.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/comgr/src/comgr-compiler.cpp b/lib/comgr/src/comgr-compiler.cpp
+index 2a7362a..bb1c9d3 100644
+--- comgr/src/comgr-compiler.cpp
++++ comgr/src/comgr-compiler.cpp
+@@ -39,6 +39,7 @@
+ #include "comgr-compiler.h"
+ #include "comgr-device-libs.h"
+ #include "comgr-env.h"
++#include "lld/Common/CommonLinkerContext.h"
+ #include "lld/Common/Driver.h"
+ #include "clang/Basic/Version.h"
+ #include "clang/CodeGen/CodeGenAction.h"
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-nullopt.patch b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-nullopt.patch
new file mode 100644
index 000000000000..8bb07b55a3ab
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-nullopt.patch
@@ -0,0 +1,23 @@
+From e1da67c6acb2b0e4a8f9c05c89e3778252ea5aa7 Mon Sep 17 00:00:00 2001
+From: Ron Lieberman <ron.lieberman@amd.com>
+Date: Sat, 17 Dec 2022 19:58:26 -0600
+Subject: [PATCH] None -> std::nullopt
+
+Change-Id: I1cc241aa47de538f9f5b1c12cb5655aca8a4502f
+---
+ lib/comgr/src/comgr-env.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/comgr/src/comgr-env.cpp b/lib/comgr/src/comgr-env.cpp
+index 742f4d4..6ab6f0f 100644
+--- comgr/src/comgr-env.cpp
++++ comgr/src/comgr-env.cpp
+@@ -53,7 +53,7 @@ bool shouldSaveTemps() {
+ Optional<StringRef> getRedirectLogs() {
+ static char *RedirectLogs = getenv("AMD_COMGR_REDIRECT_LOGS");
+ if (!RedirectLogs || StringRef(RedirectLogs) == "0") {
+- return None;
++ return std::nullopt;
+ }
+ return StringRef(RedirectLogs);
+ }
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-opt_mrelax.patch b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-opt_mrelax.patch
new file mode 100644
index 000000000000..aa3e7c370a53
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-opt_mrelax.patch
@@ -0,0 +1,23 @@
+From b582dfb33fdb51065c22800fe02dd83207185664 Mon Sep 17 00:00:00 2001
+From: Ron Lieberman <ron.lieberman@amd.com>
+Date: Sun, 1 Jan 2023 10:35:49 -0600
+Subject: [PATCH] [llvm] move to inverted OPT_mrelax_relocations_no
+
+Change-Id: I95e48e8acf5b9124d25e5e7b86c418f1a0d9389d
+---
+ lib/comgr/src/comgr-compiler.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/comgr/src/comgr-compiler.cpp b/lib/comgr/src/comgr-compiler.cpp
+index bb1c9d3..95c1bb4 100644
+--- comgr/src/comgr-compiler.cpp
++++ comgr/src/comgr-compiler.cpp
+@@ -259,7 +259,7 @@ bool AssemblerInvocation::createFromArgs(AssemblerInvocation &Opts,
+ }
+ }
+
+- Opts.RelaxELFRelocations = Args.hasArg(OPT_mrelax_relocations);
++ Opts.RelaxELFRelocations = !Args.hasArg(OPT_mrelax_relocations_no);
+ Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 2, Diags);
+ Opts.DwarfDebugFlags =
+ std::string(Args.getLastArgValue(OPT_dwarf_debug_flags));
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-subtargetfeatures.patch b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-subtargetfeatures.patch
new file mode 100644
index 000000000000..340df3852fc2
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-5.5.1-subtargetfeatures.patch
@@ -0,0 +1,26 @@
+From 48c682d577a7955256d0bfac5d497b3feebff11c Mon Sep 17 00:00:00 2001
+From: Ron Lieberman <ron.lieberman@amd.com>
+Date: Mon, 16 Jan 2023 14:29:05 -0600
+Subject: [PATCH] [llvm merge] Move to Expected on SubtargetFeatures
+
+Change-Id: I060ceaa2b51eaa6ed1b472ea42c6788b98001088
+---
+ lib/comgr/src/comgr-objdump.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/comgr/src/comgr-objdump.cpp b/lib/comgr/src/comgr-objdump.cpp
+index 86a5d7f..6d20a3c 100644
+--- comgr/src/comgr-objdump.cpp
++++ comgr/src/comgr-objdump.cpp
+@@ -1270,7 +1270,10 @@ void llvm::DisassemHelper::DisassembleObject(const ObjectFile *Obj,
+ const Target *TheTarget = getTarget(Obj);
+
+ // Package up features to be passed to target/subtarget
+- SubtargetFeatures Features = Obj->getFeatures();
++ Expected<SubtargetFeatures> FeaturesValue = Obj->getFeatures();
++ if (!FeaturesValue)
++ WithColor::error(errs(), ToolName) << FeaturesValue.takeError();
++ SubtargetFeatures Features = *FeaturesValue;
+ std::vector<std::string> MAttrs = lld::getMAttrs();
+ if (MAttrs.size()) {
+ for (unsigned I = 0; I != MAttrs.size(); ++I) {
diff --git a/dev-libs/rocm-comgr/rocm-comgr-5.5.1.ebuild b/dev-libs/rocm-comgr/rocm-comgr-5.5.1.ebuild
new file mode 100644
index 000000000000..e005c30f1efb
--- /dev/null
+++ b/dev-libs/rocm-comgr/rocm-comgr-5.5.1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake llvm prefix
+
+LLVM_MAX_SLOT=16
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/lib/comgr"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCm-CompilerSupport-rocm-${PV}/lib/comgr"
+ KEYWORDS="~amd64"
+fi
+
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
+ "${FILESDIR}/0001-Specify-clang-exe-path-in-Driver-Creation.patch"
+ "${FILESDIR}/0001-Find-CLANG_RESOURCE_DIR-using-clang-print-resource-d.patch"
+ "${FILESDIR}/${PN}-5.3.3-HIPIncludePath-not-needed.patch"
+ "${FILESDIR}/${PN}-5.5.1-fix-tests.patch"
+ "${FILESDIR}/${PN}-5.3.3-fno-stack-protector.patch"
+ "${FILESDIR}/${PN}-5.3.3-remove-h-option.patch"
+ "${FILESDIR}/${PN}-5.5.1-nullopt.patch"
+ "${FILESDIR}/${PN}-5.5.1-opt_mrelax.patch"
+ "${FILESDIR}/${PN}-5.5.1-lld-include.patch"
+ "${FILESDIR}/${PN}-5.5.1-subtargetfeatures.patch"
+)
+
+DESCRIPTION="Radeon Open Compute Code Object Manager"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND=">=dev-libs/rocm-device-libs-${PV}
+ sys-devel/clang:${LLVM_MAX_SLOT}=
+ sys-devel/clang-runtime:=
+ sys-devel/lld:${LLVM_MAX_SLOT}="
+DEPEND="${RDEPEND}"
+
+CMAKE_BUILD_TYPE=Release
+
+src_prepare() {
+ sed '/sys::path::append(HIPPath/s,"hip","",' -i src/comgr-env.cpp || die
+ sed "/return LLVMPath;/s,LLVMPath,llvm::SmallString<128>(\"$(get_llvm_prefix ${LLVM_MAX_SLOT})\")," -i src/comgr-env.cpp || die
+ eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0-rocm_path.patch)
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLVM_DIR="$(get_llvm_prefix ${LLVM_MAX_SLOT})"
+ -DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58
+ -DBUILD_TESTING=$(usex test ON OFF)
+ )
+ cmake_src_configure
+}