From 90a9ab60c0ad3efb8170b8abc5689fa6c3d53b07 Mon Sep 17 00:00:00 2001 From: Mehran Date: Wed, 28 Oct 2026 15:40:02 +0300 Subject: [PATCH] test(libs): give the prx loader tests the MinGW runtime on their PATH guest_kernel_sys_threads_main, guest_kernel_sys_threads_main_patched and net_ipv6only_patched link the MinGW runtime statically and load libkernel_sys.prx or libSceNet.prx with LoadLibraryExW and LOAD_WITH_ALTERED_SEARCH_PATH. Windows then looks for the libraries' libstdc++-6.dll next to the .prx and on PATH, not next to the test executable where the build copies the runtime. From Git Bash, whose PATH starts with Git's mingw64/bin, the loader took Git's libstdc++-6.dll, which lacks the std::__codecvt_utf8_utf16_base members that libkernel_sys, libkernel and libc import. The threads tests hung on an "Entry Point Not Found" dialog until their 20 s timeout, and net_ipv6only_patched, which suppresses the dialog, got error 127 and aborted. On MinGW, prepend the compiler's directory to their PATH, as patched_libraries does since #10101. --- core/libs/CMakeLists.txt | 5 +++++ core/libs/prx/libSceNet/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/core/libs/CMakeLists.txt b/core/libs/CMakeLists.txt index dc463eea7f..a234de0e58 100644 --- a/core/libs/CMakeLists.txt +++ b/core/libs/CMakeLists.txt @@ -459,6 +459,11 @@ if(BUILD_TESTING) add_test(NAME guest_kernel_sys_threads_${case} COMMAND guest_kernel_sys_threads_tests ${UNPATCHED_DIR} unpatched ${case}) add_test(NAME guest_kernel_sys_threads_${case}_patched COMMAND guest_kernel_sys_threads_tests ${PATCHED_DIR} patched ${case}) set_tests_properties(guest_kernel_sys_threads_${case} guest_kernel_sys_threads_${case}_patched PROPERTIES TIMEOUT 20) + if(MINGW) + get_filename_component(kernelSysThreadsRuntimeDirectory "${CMAKE_CXX_COMPILER}" DIRECTORY) + set_tests_properties(guest_kernel_sys_threads_${case} guest_kernel_sys_threads_${case}_patched PROPERTIES + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${kernelSysThreadsRuntimeDirectory}") + endif() endforeach() add_test_executable(guest_gnm_neo_packets_tests tests/GuestGnmNeoPackets.cpp) diff --git a/core/libs/prx/libSceNet/CMakeLists.txt b/core/libs/prx/libSceNet/CMakeLists.txt index acc487792e..10ad0db42a 100644 --- a/core/libs/prx/libSceNet/CMakeLists.txt +++ b/core/libs/prx/libSceNet/CMakeLists.txt @@ -16,6 +16,11 @@ if(BUILD_TESTING) endif() add_test(NAME net_ipv6only_patched COMMAND net_ipv6only_patched_tests ${PATCHED_DIR}) set_tests_properties(net_ipv6only_patched PROPERTIES TIMEOUT 20 SKIP_RETURN_CODE 77) + if(MINGW) + get_filename_component(ipv6OnlyPatchedRuntimeDirectory "${CMAKE_CXX_COMPILER}" DIRECTORY) + set_tests_properties(net_ipv6only_patched PROPERTIES + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${ipv6OnlyPatchedRuntimeDirectory}") + endif() add_test_executable(net_ipv6only_tests tests/Ipv6Only.cpp) target_include_directories(net_ipv6only_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(net_ipv6only_tests PRIVATE libSceNet libkernel libc)