summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSv. Lockal <lockalsash@gmail.com>2024-05-06 14:56:00 +0000
committerSam James <sam@gentoo.org>2024-06-26 10:18:56 +0100
commit43a35716e3e7dc3c176385cf855b0bd8ccb18e82 (patch)
tree3fc63c8ac7ce2a6cb3fe614676e4d0de4474f1c3 /dev-libs
parentdev-libs/rocr-runtime: add 6.1.1 (diff)
downloadgentoo-43a35716e3e7dc3c176385cf855b0bd8ccb18e82.tar.gz
gentoo-43a35716e3e7dc3c176385cf855b0bd8ccb18e82.tar.bz2
gentoo-43a35716e3e7dc3c176385cf855b0bd8ccb18e82.zip
dev-libs/rocr-runtime: fix crash in musl and compile issue with ld.lld
Upstream issues: * https://github.com/ROCm/ROCR-Runtime/issues/181#issuecomment-2096231767 * https://github.com/ROCm/ROCR-Runtime/issues/204 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch17
-rw-r--r--dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch40
-rw-r--r--dev-libs/rocr-runtime/rocr-runtime-6.1.1.ebuild1
3 files changed, 47 insertions, 11 deletions
diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch
new file mode 100644
index 000000000000..fb5d3d341967
--- /dev/null
+++ b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch
@@ -0,0 +1,17 @@
+Fix "symbol not defined" when linking with ld.lld >= 17
+https://github.com/ROCm/ROCR-Runtime/issues/204
+--- a/hsacore.so.def
++++ b/hsacore.so.def
+@@ -246,12 +246,6 @@ global:
+ hsa_amd_vmem_retain_alloc_handle;
+ hsa_amd_vmem_get_alloc_properties_from_handle;
+ hsa_amd_agent_set_async_scratch_limit;
+- hsa_tools_scratch_event_alloc_start;
+- hsa_tools_scratch_event_alloc_end;
+- hsa_tools_scratch_event_free_start;
+- hsa_tools_scratch_event_free_end;
+- hsa_tools_scratch_event_async_reclaim_start;
+- hsa_tools_scratch_event_async_reclaim_end;
+
+ local:
+ *;
diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch
index 699f9251d705..7554c8c79ec1 100644
--- a/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch
+++ b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch
@@ -1,8 +1,6 @@
-Fix compilation with musl.
+Fix compilation and symbol search with musl.
Bug: https://github.com/ROCm/ROCR-Runtime/issues/181
-Index: src/core/inc/checked.h
-===================================================================
--- src.orig/core/inc/checked.h
+++ src/core/inc/checked.h
@@ -58,7 +58,7 @@ template <uint64_t code, bool multiProce
@@ -14,8 +12,6 @@ Index: src/core/inc/checked.h
const Check& operator=(Check&& rhs) { return *this; }
const Check& operator=(const Check& rhs) { return *this; }
-Index: src/core/runtime/default_signal.cpp
-===================================================================
--- src.orig/core/runtime/default_signal.cpp
+++ src/core/runtime/default_signal.cpp
@@ -57,7 +57,7 @@ int BusyWaitSignal::rtti_id_ = 0;
@@ -27,8 +23,6 @@ Index: src/core/runtime/default_signal.cpp
}
hsa_signal_value_t BusyWaitSignal::LoadRelaxed() {
-Index: src/core/util/lnx/os_linux.cpp
-===================================================================
--- src.orig/core/util/lnx/os_linux.cpp
+++ src/core/util/lnx/os_linux.cpp
@@ -130,9 +130,12 @@ class os_thread {
@@ -60,8 +54,6 @@ Index: src/core/util/lnx/os_linux.cpp
pthread_rwlock_t* lock = new pthread_rwlock_t;
err = pthread_rwlock_init(lock, &attrib);
-Index: src/core/util/utils.h
-===================================================================
--- src.orig/core/util/utils.h
+++ src/core/util/utils.h
@@ -74,7 +74,7 @@ static __forceinline void* _aligned_mall
@@ -73,8 +65,6 @@ Index: src/core/util/utils.h
return NULL;
return mem;
#endif
-Index: src/image/util.h
-===================================================================
--- src.orig/image/util.h
+++ src/image/util.h
@@ -99,7 +99,7 @@ static __forceinline void* _aligned_mall
@@ -86,3 +76,31 @@ Index: src/image/util.h
return mem;
#endif
}
+--- src.orig/core/util/lnx/os_linux.cpp
++++ src/core/util/lnx/os_linux.cpp
+@@ -65,6 +65,16 @@
+ #include <cpuid.h>
+ #endif
+
++/*
++ * d_un.d_ptr is relative on non glibc systems
++ * elf(5) documents it this way, glibc diverts from this documentation
++ */
++#ifdef __GLIBC__
++#define ABS_ADDR(base, ptr) (ptr)
++#else
++#define ABS_ADDR(base, ptr) ((base) + (ptr))
++#endif
++
+ namespace rocr {
+ namespace os {
+
+@@ -299,7 +309,7 @@ static int callback(struct dl_phdr_info* info, size_t size, void* data) {
+ for (int j = 0;; j++) {
+ if (dyn_section[j].d_tag == DT_NULL) break;
+
+- if (dyn_section[j].d_tag == DT_STRTAB) strings = (char*)(dyn_section[j].d_un.d_ptr);
++ if (dyn_section[j].d_tag == DT_STRTAB) strings = (char*)ABS_ADDR(info->dlpi_addr, dyn_section[j].d_un.d_ptr);
+
+ if (dyn_section[j].d_tag == DT_STRSZ) limit = dyn_section[j].d_un.d_val;
+ }
diff --git a/dev-libs/rocr-runtime/rocr-runtime-6.1.1.ebuild b/dev-libs/rocr-runtime/rocr-runtime-6.1.1.ebuild
index 8b2730bd07e2..06778711004a 100644
--- a/dev-libs/rocr-runtime/rocr-runtime-6.1.1.ebuild
+++ b/dev-libs/rocr-runtime/rocr-runtime-6.1.1.ebuild
@@ -23,6 +23,7 @@ PATCHES=(
"${FILESDIR}/${PN}-4.3.0_no-aqlprofiler.patch"
"${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
"${FILESDIR}/${PN}-6.1.0-musl.patch"
+ "${FILESDIR}/${PN}-6.1.0-ld-lld.patch"
)
LICENSE="MIT"