From 196baa43216c71c646016414994104a2d889838e Mon Sep 17 00:00:00 2001 From: German Andryeyev <56892148+gandryey@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:44:51 -0500 Subject: [PATCH] rocr: Fix static build in Windows (#2660) --- projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt | 8 ++++---- .../runtime/hsa-runtime/core/util/win/os_win.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt index b8aac0e5bf..f17b2de17d 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt @@ -457,9 +457,9 @@ if( NOT ${BUILD_SHARED_LIBS} ) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindLibElf.cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/COPYING-CMAKE-SCRIPTS DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CORE_RUNTIME_NAME} COMPONENT dev) + # Linker script (defines function aliases) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LNKSCR} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CORE_RUNTIME_NAME} + COMPONENT dev) endif() - # Linker script (defines function aliases) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LNKSCR} - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CORE_RUNTIME_NAME} - COMPONENT dev) endif() diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/win/os_win.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/util/win/os_win.cpp index d7b2567945..cddab61c64 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/win/os_win.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/win/os_win.cpp @@ -472,7 +472,7 @@ bool MapMemory(void* addr, size_t size, MemProt perms, int fd [[maybe_unused]], bool ProtectMemory(void* va, size_t size, MemProt perms) { if (perms == MEM_PROT_NONE) { - return UncommitMemory(addr, size); + return UncommitMemory(va, size); } DWORD oldProt; return VirtualProtect(va, size, memProtToOsProt(perms), &oldProt) != 0;