Commit Graph
12 Commits
Author SHA1 Message Date
harisibrar1andClaude Opus 5.5 e1342e7de2 test(relinker): find the Windows test executables with GetModuleFileNameW
autorun_exit_tests built its own path from argv[0] and
windows_dependency_diagnostics_tests from GetModuleFileNameA. Both are in
the ANSI code page on Windows, but MinGW's std::filesystem::path reads a
narrow string as UTF-8, so in a build directory with characters such as
"ü" both tests stopped with "Cannot convert character sequence: Illegal
byte sequence" before testing anything (windows_diagnostic_fixture_isolation
runs the second one).

Take the path from GetModuleFileNameW on Windows. The relinker and the
generated diagnostic runner already use UTF-8 and wide APIs, so nothing
else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 08:48:34 -04:00
MarcZX10 0d0b29cf44 test(relinker): require libc for kernel variant fallback 2026-10-21 05:47:05 +00:00
MarcZX10 fef2755c76 test(relinker): cover scoped kernel variant imports 2026-10-21 03:42:04 +00:00
JJenkxandClaude Opus 5.5 92ea0b9ce3 test(relinker): wait for the exited diagnostic runner to release its fixtures
windows_dependency_diagnostics rewrites the fixture images right after the
diagnostic runner exits. The runner ends with an unhandled RaiseException of
STATUS_DLL_NOT_FOUND, and Windows fault handling keeps the exited process's
image files open for a short time after its handle is signaled: on Windows 11
22621 the Restart Manager names the exited runner as the holder and the file
opens 37 to 153 ms later. The rewrite then fails with ERROR_SHARING_VIOLATION,
and the final removal of the fixtures with access denied. Retry opening a
fixture while it fails with a sharing violation and the removal while it fails
with access denied, for at most 10 s each; every other failure still fails the
test at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:45:35 -04:00
UAQ Taxi 379dca5cac test: raise the slow-host timeouts 2026-10-19 14:49:36 +02:00
Get-fix 8c34587598 fix(relinker): search libc.prx for libkernel-only Windows executables
AnyPS5 exports some libkernel functions, such as __error, from
libc.prx, which libkernel.prx links. On Linux they resolve through that
dependency. On Windows, the import stubs search only the listed
modules, and libc.prx was listed only when libSceLibcInternal.prx was
needed. A PS4 homebrew that needs libkernel.prx but no C library (the
OpenOrbis graphics sample) failed with "unresolved ELF import
9BcDykPmo1I". libc.prx is now also listed when libkernel.prx is needed.
PS5 executables need libSceLibcInternal.prx and convert unchanged.
2026-10-15 21:02:31 +03:00
NikoandClaude Opus 5.5 4ba4ede2a9 fix(relinker): name missing and non-PE modules in Windows dependency diagnostics
When a relinked executable fails to load a staged module, the dependency
diagnostics routine maps the same path as an image resource to walk its
imports. If that mapping failed it printed only "FAIL: dependency
diagnostics Windows API failed". The log then did not say whether the
staged module itself (libs\libSceRegMgr.prx in #4720) was absent or was
not a Windows image, and a module reached through another module's
imports was not named at all.

The register routine now reads GetLastError when LoadLibraryExW fails.
ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND print "dependency module
not found", ERROR_BAD_EXE_FORMAT prints "dependency module is not a
Windows PE image"; both name the module path, its importer and the
chain from the executable, like the existing missing-module report.
Other errors keep the generic message. An API set contract that
LoadLibraryExA reports as ERROR_MOD_NOT_FOUND now gets the
missing-module report too.

Refs #4720

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 01:51:23 +02:00
Doston AbdullayevandClaude Opus 5.5 28b1f1578f fix(relinker): walk Windows dependency diagnostics through the wide API
The --windows-diagnostics walker looked up modules and directories with
GetModuleHandleA, LoadLibraryExA, GetFileAttributesA,
GetModuleFileNameA and GetSystemDirectoryA, so under a directory outside
the ANSI code page it failed with "dependency diagnostics Windows API
failed" instead of naming the missing dependency.

Keep the walker's paths in UTF-8 and convert them at the Windows API
calls, which now use the wide functions. The entry stub passes it, and
prints, its paths as UTF-8 instead of the ANSI code page. The dependency
diagnostics test now builds its fixtures under a non-ASCII directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 19:42:28 +00:00
Hannah Lyons 0e03ad0f95 fix(relinker): skip repeated DT_NEEDED libraries 2026-10-10 21:23:19 +13:00
gunerky a58fe0cd72 test(relinker): isolate Windows diagnostic fixtures 2026-10-09 23:59:29 +03:00
SamG-Coder f146a3d069 fix(windows): expose shared libc for internal runtime imports 2026-09-25 06:00:07 +10:00
boykopovar 9d7c255316 feat(windows): add import error chain diagnostic 2026-09-12 15:55:46 +03:00