commit:     cd5841411628af6aa1ea693b9d477e06658cfec8
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Tue Jun 25 20:58:01 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 09:19:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd584141

dev-util/hip: 6.1.1 reuse patch

The extend-isa-compatibility-check patch already exists, so reuse it to safe
some space in /files

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...p-6.1.0-extend-isa-compatibility-check-v2.patch | 35 ++++++++++++++++++++++
 dev-util/hip/hip-6.1.1.ebuild                      | 11 ++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git 
a/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check-v2.patch 
b/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check-v2.patch
new file mode 100644
index 000000000000..d6e95c994c8f
--- /dev/null
+++ b/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check-v2.patch
@@ -0,0 +1,35 @@
+From e188c092a987c45caf2ea4651686ea631ca47c3d Mon Sep 17 00:00:00 2001
+From: Paul Zander <[email protected]>
+Date: Tue, 25 Jun 2024 15:22:33 +0200
+Subject: [PATCH] prepare usage of old patch
+
+Signed-off-by: Paul Zander <[email protected]>
+---
+ hipamd/src/hip_code_object.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/hipamd/src/hip_code_object.cpp b/hipamd/src/hip_code_object.cpp
+index 6b3a6d0..fef89df 100644
+--- a/hipamd/src/hip_code_object.cpp
++++ b/hipamd/src/hip_code_object.cpp
+@@ -410,7 +410,7 @@ static bool isCodeObjectCompatibleWithDevice(std::string 
co_triple_target_id,
+   if (co_triple_target_id == agent_triple_target_id) return true;
+ 
+   // Parse code object triple target id
+-  if (!consume(co_triple_target_id, std::string(kAmdgcnTargetTriple) + '-')) {
++  if (!consume(co_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) 
{
+     return false;
+   }
+ 
+@@ -423,7 +423,7 @@ static bool isCodeObjectCompatibleWithDevice(std::string 
co_triple_target_id,
+   if (!co_triple_target_id.empty()) return false;
+ 
+   // Parse agent isa triple target id
+-  if (!consume(agent_triple_target_id, std::string(kAmdgcnTargetTriple) + 
'-')) {
++  if (!consume(agent_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + 
'-')) {
+     return false;
+   }
+ 
+-- 
+2.45.2
+

diff --git a/dev-util/hip/hip-6.1.1.ebuild b/dev-util/hip/hip-6.1.1.ebuild
index ecdf174fed4b..12f75f31f339 100644
--- a/dev-util/hip/hip-6.1.1.ebuild
+++ b/dev-util/hip/hip-6.1.1.ebuild
@@ -48,7 +48,6 @@ RDEPEND="${DEPEND}
 PATCHES=(
        "${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
        "${FILESDIR}/${PN}-6.1.0-install.patch"
-       "${FILESDIR}/${PN}-6.1.0-extend-isa-compatibility-check.patch"
        "${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
 )
 
@@ -60,6 +59,16 @@ hip_test_wrapper() {
 }
 
 src_prepare() {
+       # NOTE We do this head stand to safe the patch size.
+       # NOTE Adjust when we drop 5.7.1
+       sed \
+               -e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
+               -i hipamd/src/hip_code_object.cpp || die
+       eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
+       sed \
+               -e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
+               -i hipamd/src/hip_code_object.cpp || die
+
        # hipamd is itself built by cmake, and should never provide a
        # FindHIP.cmake module. But the reality is some package relies on it.
        # Set HIP and HIP Clang paths directly, don't search using heuristics

Reply via email to