diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-06-27 07:59:40 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-06-27 07:59:40 +0100 |
commit | d2ed973482fdd800013658e83a61709b29e0a80f (patch) | |
tree | 57ea7666a57b5a05a4c8866e4915e90b4a6e7c94 /dev-libs/rocr-runtime/files | |
parent | 9f6a82a85d400d6ae7de04c43cee88dbc6bc4da0 (diff) |
gentoo auto-resync : 27:06:2024 - 07:59:39
Diffstat (limited to 'dev-libs/rocr-runtime/files')
4 files changed, 135 insertions, 1 deletions
diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch index b12352e40c92..f0106abd6652 100644 --- a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch +++ b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch @@ -45,7 +45,7 @@ https://salsa.debian.org/rocm-team/rocr-runtime/-/blob/master/debian/patches/000 + } + } else if (code_object_isa.GetMajorVersion() == 10) { + if (code_object_isa.GetMinorVersion() == 1) { -+ const std::array<int32_t, 2> gfx1010_equivalent = { 0, 2 }; ++ const std::array<int32_t, 1> gfx1010_equivalent = { 0 }; + const std::array<int32_t, 4> gfx1010_superset = { 0, 1, 2, 3 }; + if (Contains(gfx1010_equivalent, code_object_isa.GetStepping()) && + Contains(gfx1010_superset, agent_isa.GetStepping())) { diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch index 0e8e53209738..13d731adb3a2 100644 --- a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch +++ b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch @@ -23,6 +23,17 @@ Bug: https://github.com/ROCm/ROCR-Runtime/issues/181 } hsa_signal_value_t BusyWaitSignal::LoadRelaxed() { +--- a/core/runtime/hsa.cpp ++++ b/core/runtime/hsa.cpp +@@ -155,7 +155,7 @@ template <class T> struct ValidityError<const T*> { + + template <class T> + static __forceinline bool IsValid(T* ptr) { +- return (ptr == NULL) ? NULL : ptr->IsValid(); ++ return (ptr == NULL) ? false : ptr->IsValid(); + } + + namespace AMD { --- a/core/util/lnx/os_linux.cpp +++ b/core/util/lnx/os_linux.cpp @@ -111,9 +111,12 @@ class os_thread { 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 new file mode 100644 index 000000000000..7554c8c79ec1 --- /dev/null +++ b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch @@ -0,0 +1,106 @@ +Fix compilation and symbol search with musl. + +Bug: https://github.com/ROCm/ROCR-Runtime/issues/181 +--- src.orig/core/inc/checked.h ++++ src/core/inc/checked.h +@@ -58,7 +58,7 @@ template <uint64_t code, bool multiProce + Check(const Check&) { object_ = uintptr_t(this) ^ uintptr_t(code); } + Check(Check&&) { object_ = uintptr_t(this) ^ uintptr_t(code); } + +- ~Check() { object_ = NULL; } ++ ~Check() { object_ = uintptr_t(NULL); } + + const Check& operator=(Check&& rhs) { return *this; } + const Check& operator=(const Check& rhs) { return *this; } +--- src.orig/core/runtime/default_signal.cpp ++++ src/core/runtime/default_signal.cpp +@@ -57,7 +57,7 @@ int BusyWaitSignal::rtti_id_ = 0; + BusyWaitSignal::BusyWaitSignal(SharedSignal* abi_block, bool enableIPC) + : Signal(abi_block, enableIPC) { + signal_.kind = AMD_SIGNAL_KIND_USER; +- signal_.event_mailbox_ptr = NULL; ++ signal_.event_mailbox_ptr = uint64_t(NULL); + } + + hsa_signal_value_t BusyWaitSignal::LoadRelaxed() { +--- src.orig/core/util/lnx/os_linux.cpp ++++ src/core/util/lnx/os_linux.cpp +@@ -130,9 +130,12 @@ class os_thread { + } + } + ++ int cores = 0; ++ cpu_set_t* cpuset = nullptr; ++ + if (core::Runtime::runtime_singleton_->flag().override_cpu_affinity()) { +- int cores = get_nprocs_conf(); +- cpu_set_t* cpuset = CPU_ALLOC(cores); ++ cores = get_nprocs_conf(); ++ cpuset = CPU_ALLOC(cores); + if (cpuset == nullptr) { + fprintf(stderr, "CPU_ALLOC failed: %s\n", strerror(errno)); + return; +@@ -642,11 +645,13 @@ SharedMutex CreateSharedMutex() { + fprintf(stderr, "rw lock attribute init failed: %s\n", strerror(err)); + return nullptr; + } ++#if defined(__GLIBC__) + err = pthread_rwlockattr_setkind_np(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); + if (err != 0) { + fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err)); + return nullptr; + } ++#endif + + pthread_rwlock_t* lock = new pthread_rwlock_t; + err = pthread_rwlock_init(lock, &attrib); +--- src.orig/core/util/utils.h ++++ src/core/util/utils.h +@@ -74,7 +74,7 @@ static __forceinline void* _aligned_mall + return aligned_alloc(alignment, size); + #else + void *mem = NULL; +- if (NULL != posix_memalign(&mem, alignment, size)) ++ if (0 != posix_memalign(&mem, alignment, size)) + return NULL; + return mem; + #endif +--- src.orig/image/util.h ++++ src/image/util.h +@@ -99,7 +99,7 @@ static __forceinline void* _aligned_mall + return aligned_alloc(alignment, size); + #else + void* mem = NULL; +- if (NULL != posix_memalign(&mem, alignment, size)) return NULL; ++ if (0 != posix_memalign(&mem, alignment, size)) return NULL; + 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; + } |