commit:     72d3f776254a05d1676733c2bf4da171ee07a53d
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Oct 17 09:42:01 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Oct 17 14:31:28 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72d3f776

dev-util/hip: drop unused patches

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44218
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-util/hip/files/hip-5.7.0-install.patch         | 13 -----
 .../files/hip-5.7.1-disable-stack-protector.patch  | 13 -----
 dev-util/hip/files/hip-5.7.1-exec-stack.patch      | 31 ----------
 .../hip/files/hip-5.7.1-fix-mmap-oom-check.patch   | 41 -------------
 .../hip/files/hip-5.7.1-fix-unaligned-access.patch | 67 ----------------------
 dev-util/hip/files/hip-6.1.0-install.patch         | 20 -------
 ...test-5.7.0-rocm_agent_enumerator-location.patch | 15 -----
 .../hip-test-6.0.2-hipcc-system-install.patch      | 43 --------------
 ...-test-6.1.0-disable-hipKerArgOptimization.patch | 24 --------
 9 files changed, 267 deletions(-)

diff --git a/dev-util/hip/files/hip-5.7.0-install.patch 
b/dev-util/hip/files/hip-5.7.0-install.patch
deleted file mode 100644
index 668e24af7c52..000000000000
--- a/dev-util/hip/files/hip-5.7.0-install.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt
-index a472c5b7a..ac6fdc2ab 100755
---- a/hipamd/CMakeLists.txt
-+++ b/hipamd/CMakeLists.txt
-@@ -396,8 +396,6 @@ if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
-   install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
-   install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
-   install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
- endif()
- 
- #############################

diff --git a/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch 
b/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch
deleted file mode 100644
index 49d944ef4bc9..000000000000
--- a/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Disable stack-protector (which is enabled by default gentoo-hardened) in 
device code.
-This is not required after https://github.com/llvm/llvm-project/pull/70799, 
but helps with older clang.
-Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/21
---- a/hipamd/src/hiprtc/hiprtcInternal.cpp
-+++ b/hipamd/src/hiprtc/hiprtcInternal.cpp
-@@ -144,6 +144,7 @@ RTCCompileProgram::RTCCompileProgram(std::string name_) : 
RTCProgram(name_), fgp
-   compile_options_.push_back("-nogpuinc");
-   compile_options_.push_back("-Wno-gnu-line-marker");
-   compile_options_.push_back("-Wno-missing-prototypes");
-+  compile_options_.push_back("-fno-stack-protector");
- #ifdef _WIN32
-   compile_options_.push_back("-target");
-   compile_options_.push_back("x86_64-pc-windows-msvc");

diff --git a/dev-util/hip/files/hip-5.7.1-exec-stack.patch 
b/dev-util/hip/files/hip-5.7.1-exec-stack.patch
deleted file mode 100644
index 744ca7b953c3..000000000000
--- a/dev-util/hip/files/hip-5.7.1-exec-stack.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/22
---- a/hipamd/src/hip_embed_pch.sh
-+++ b/hipamd/src/hip_embed_pch.sh
-@@ -178,6 +178,7 @@ EOF
- 
-   echo "// Automatically generated script for HIP RTC." > $mcinFile
-   if [[ $isWindows -eq 0 ]]; then
-+    echo "  .section .note.GNU-stack,"",%progbits" >> $mcinFile
-     echo "  .type __hipRTC_header,@object" >> $mcinFile
-     echo "  .type __hipRTC_header_size,@object" >> $mcinFile
-   fi
---- a/hipamd/src/hiprtc/cmake/HIPRTC.cmake
-+++ b/hipamd/src/hiprtc/cmake/HIPRTC.cmake
-@@ -98,6 +98,7 @@ macro(generate_hiprtc_mcin HiprtcMcin 
HiprtcPreprocessedInput)
-     set(HIPRTC_TYPE_LINUX_ONLY "")
-   else()
-     set(HIPRTC_TYPE_LINUX_ONLY
-+      "  .section .note.GNU-stack,\"\",%progbits\n"
-       "  .type __hipRTC_header,@object\n"
-       "  .type __hipRTC_header_size,@object")
-   endif()
---- a/hipamd/src/hip_embed_pch.sh
-+++ b/hipamd/src/hip_embed_pch.sh
-@@ -111,6 +111,7 @@ cat >$tmp/hip_pch.h <<EOF
- EOF
- 
- cat >$tmp/hip_pch.mcin <<EOF
-+  .section .note.GNU-stack,"",%progbits
-   .type __hip_pch_wave32,@object
-   .section .hip_pch_wave32,"aMS",@progbits,1
-   .data

diff --git a/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch 
b/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch
deleted file mode 100644
index dbafe4e11a74..000000000000
--- a/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-Backport of SWDEV-417691 - Error handling for MemoryMap OS calls.
-The issue was fixed in rocclr 6.0.0.
-https://github.com/ROCm/clr/commit/7a10423a44b8b353f67539dc1ae14c0b99c209b8
---- a/rocclr/os/os_posix.cpp
-+++ b/rocclr/os/os_posix.cpp
-@@ -214,7 +214,7 @@ address Os::reserveMemory(address start, size_t size, 
size_t alignment, MemProt
-                                 MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS, 
0, 0);
- 
-   // check for out of memory
--  if (mem == NULL) return NULL;
-+  if (mem == MAP_FAILED) return NULL;
- 
-   address aligned = alignUp(mem, alignment);
- 
-@@ -842,7 +842,7 @@ bool Os::MemoryMapFileDesc(FileDesc fdesc, size_t fsize, 
size_t foffset, const v
-   }
- 
-   *mmap_ptr = mmap(NULL, fsize, PROT_READ, MAP_SHARED, fdesc, foffset);
--  return true;
-+  return (*mmap_ptr == MAP_FAILED) ? false : true;
- }
- 
- bool Os::MemoryUnmapFile(const void* mmap_ptr, size_t mmap_size) {
-@@ -874,7 +874,7 @@ bool Os::MemoryMapFile(const char* fname, const void** 
mmap_ptr, size_t* mmap_si
- 
-   close(fd);
- 
--  if (*mmap_ptr == nullptr) {
-+  if (*mmap_ptr == MAP_FAILED) {
-     return false;
-   }
- 
-@@ -899,7 +899,7 @@ bool Os::MemoryMapFileTruncated(const char* fname, const 
void** mmap_ptr, size_t
- 
-   close(fd);
- 
--  if (*mmap_ptr == nullptr) {
-+  if (*mmap_ptr == MAP_FAILED) {
-     return false;
-   }
- 
\ No newline at end of file

diff --git a/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch 
b/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch
deleted file mode 100644
index ae2092f6e1ac..000000000000
--- a/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-Fix SIGSEGV when compiled with avx-512 instructions.
-
-Due to unaligned allocations, library crashes in
-nontemporalMemcpy in _mm512_stream_si512 (which requires
-64-aligned allocations, but used to copy default-aligned objects).
-
-Without this patch hipamd causes random crashes in hipMemcpy* callers
-(tensile, rocBLAS, miopen, rocThrust, etc.).
-
-Bug: https://bugs.gentoo.org/915969
-Bug report in upstream: https://github.com/ROCm-Developer-Tools/clr/issues/18
---- a/rocclr/device/rocm/rocvirtual.cpp
-+++ b/rocclr/device/rocm/rocvirtual.cpp
-@@ -2790,44 +2790,6 @@ bool VirtualGPU::createVirtualQueue(uint 
deviceQueueSize)
-   return true;
- }
- 
--// 
================================================================================================
--__attribute__((optimize("unroll-all-loops"), always_inline))
--static inline void nontemporalMemcpy(void* __restrict dst, const void* 
__restrict src,
--                              uint16_t size) {
--  #if defined(__AVX512F__)
--    for (auto i = 0u; i != size / sizeof(__m512i); ++i) {
--      _mm512_stream_si512(reinterpret_cast<__m512i* __restrict&>(dst)++,
--                          *reinterpret_cast<const __m512i* 
__restrict&>(src)++);
--    }
--    size = size % sizeof(__m512i);
--  #endif
--
--  #if defined(__AVX__)
--    for (auto i = 0u; i != size / sizeof(__m256i); ++i) {
--      _mm256_stream_si256(reinterpret_cast<__m256i* __restrict&>(dst)++,
--                          *reinterpret_cast<const __m256i* 
__restrict&>(src)++);
--    }
--    size = size % sizeof(__m256i);
--  #endif
--
--  for (auto i = 0u; i != size / sizeof(__m128i); ++i) {
--    _mm_stream_si128(reinterpret_cast<__m128i* __restrict&>(dst)++,
--                     *(reinterpret_cast<const __m128i* __restrict&>(src)++));
--  }
--  size = size % sizeof(__m128i);
--
--  for (auto i = 0u; i != size / sizeof(long long); ++i) {
--    _mm_stream_si64(reinterpret_cast<long long* __restrict&>(dst)++,
--                    *reinterpret_cast<const long long* __restrict&>(src)++);
--  }
--  size = size % sizeof(long long);
--
--  for (auto i = 0u; i != size / sizeof(int); ++i) {
--    _mm_stream_si32(reinterpret_cast<int* __restrict&>(dst)++,
--                    *reinterpret_cast<const int* __restrict&>(src)++);
--  }
--}
--
- // 
================================================================================================
- bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
-     const amd::Kernel& kernel, const_address parameters, void* eventHandle,
-@@ -3096,7 +3058,7 @@ bool VirtualGPU::submitKernelInternal(const 
amd::NDRangeContainer& sizes,
-       argBuffer = 
reinterpret_cast<address>(allocKernArg(gpuKernel.KernargSegmentByteSize(),
-                                             
gpuKernel.KernargSegmentAlignment()));
-       // Load all kernel arguments
--      nontemporalMemcpy(argBuffer, parameters,
-+      memcpy(argBuffer, parameters,
-                         std::min(gpuKernel.KernargSegmentByteSize(),
-                                  signature.paramsSize()));
-     }

diff --git a/dev-util/hip/files/hip-6.1.0-install.patch 
b/dev-util/hip/files/hip-6.1.0-install.patch
deleted file mode 100644
index 416663f6ea48..000000000000
--- a/dev-util/hip/files/hip-6.1.0-install.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-These files already installed by hipcc, which is a runtime dep
---- a/hipamd/CMakeLists.txt
-+++ b/hipamd/CMakeLists.txt
-@@ -401,16 +401,7 @@ if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
-       set(hipcc_bin ${hipcc_bin}.exe)
-       set(hipconfig_bin ${hipconfig_bin}.exe)
-     endif()
--    if(EXISTS ${hipcc_bin} AND EXISTS ${hipconfig_bin})
--      install(PROGRAMS ${hipcc_bin} DESTINATION bin)
--      install(PROGRAMS ${hipconfig_bin} DESTINATION bin)
--    endif()
-   endif()
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc DESTINATION bin)
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig DESTINATION bin)
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
--  install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
-   if(WIN32)
-     install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
-     install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
\ No newline at end of file

diff --git 
a/dev-util/hip/files/hip-test-5.7.0-rocm_agent_enumerator-location.patch 
b/dev-util/hip/files/hip-test-5.7.0-rocm_agent_enumerator-location.patch
deleted file mode 100644
index 1d967212ac9a..000000000000
--- a/dev-util/hip/files/hip-test-5.7.0-rocm_agent_enumerator-location.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH.
-
---- catch/CMakeLists.txt~      2023-11-18 13:56:08.000000000 +0800
-+++ catch/CMakeLists.txt       2023-11-18 13:59:28.136170638 +0800
-@@ -182,9 +182,8 @@
- # rocm_agent_enumerator
- if(NOT DEFINED OFFLOAD_ARCH_STR
-    AND NOT DEFINED ENV{HCC_AMDGPU_TARGET}
--   AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerator"
-    AND HIP_PLATFORM STREQUAL "amd" AND UNIX)
--    execute_process(COMMAND ${ROCM_PATH}/bin/rocm_agent_enumerator
-+    execute_process(COMMAND rocm_agent_enumerator
-          OUTPUT_VARIABLE HIP_GPU_ARCH
-          RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT)
-     # Trim out gfx000

diff --git a/dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch 
b/dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch
deleted file mode 100644
index bf143939d13e..000000000000
--- a/dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH.
-
-Index: catch/CMakeLists.txt
-===================================================================
---- catch.orig/CMakeLists.txt
-+++ catch/CMakeLists.txt
-@@ -55,9 +55,9 @@ endif()
- message(STATUS "HIP_PATH: ${HIP_PATH}")
- message(STATUS "ROCM_PATH: ${ROCM_PATH}")
- 
--set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc${EXT}")
--set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc${EXT}")
--set(HIPCONFIG_EXECUTABLE "${HIP_PATH}/bin/hipconfig${EXT}")
-+set(CMAKE_CXX_COMPILER "hipcc${EXT}")
-+set(CMAKE_C_COMPILER "hipcc${EXT}")
-+set(HIPCONFIG_EXECUTABLE "hipconfig${EXT}")
- execute_process(COMMAND ${HIPCONFIG_EXECUTABLE} --version
-                 OUTPUT_VARIABLE HIP_VERSION
-                 OUTPUT_STRIP_TRAILING_WHITESPACE)
-@@ -183,9 +183,8 @@ message(STATUS "CMAKE HIP ARCHITECTURES:
- # OFFLOAD_ARCH_STR
- # rocm_agent_enumerator
- if(NOT DEFINED OFFLOAD_ARCH_STR
--   AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerator"
-    AND HIP_PLATFORM STREQUAL "amd" AND UNIX)
--    execute_process(COMMAND "${ROCM_PATH}/bin/rocm_agent_enumerator"
-+    execute_process(COMMAND "rocm_agent_enumerator"
-          OUTPUT_VARIABLE HIP_GPU_ARCH
-          RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT
-          OUTPUT_STRIP_TRAILING_WHITESPACE)
-Index: catch/hipTestMain/hip_test_context.cc
-===================================================================
---- catch.orig/hipTestMain/hip_test_context.cc
-+++ catch/hipTestMain/hip_test_context.cc
-@@ -37,7 +37,7 @@ std::string TestContext::substringFound(
- 
- std::string TestContext::getCurrentArch() {
- #if HT_LINUX
--  const char* cmd = "/opt/rocm/bin/rocm_agent_enumerator | sort -u | xargs | 
sed -e 's/ /;/g'";
-+  const char* cmd = "rocm_agent_enumerator | sort -u | xargs | sed -e 's/ 
/;/g'";
-   std::array<char, 1024> buffer;
-   std::string result;
-   std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);

diff --git 
a/dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch 
b/dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch
deleted file mode 100644
index cb65ebae62be..000000000000
--- a/dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Those tests requires >=clang-18 to support -amdgpu-kernarg-preload-count
-index afdf8c4..28b0198 100644
---- a/unit/module/CMakeLists.txt
-+++ b/unit/module/CMakeLists.txt
-@@ -41,9 +41,6 @@ add_custom_target(copyKernel.s
-                   -I${CMAKE_CURRENT_SOURCE_DIR}/../../include 
--rocm-path=${ROCM_PATH})
- 
- if(UNIX)
--set(TEST_SRC
--    ${TEST_SRC}
--    hipKerArgOptimization.cc)
- 
- add_custom_target(copiousArgKernel.code
-                   COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
-@@ -106,8 +103,4 @@ hip_add_exe_to_target(NAME ModuleTest
-   TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
- 
- add_dependencies(build_tests copyKernel.code copyKernel.s)
--if(UNIX)
--add_dependencies(build_tests copiousArgKernel.code copiousArgKernel0.code 
copiousArgKernel1.code copiousArgKernel2.code
--copiousArgKernel3.code copiousArgKernel16.code copiousArgKernel17.code)
- endif()
--endif()
-\ No newline at end of file

Reply via email to