Repository navigation
feat(relinker): hint at the MinGW runtime DLLs when a module fails to load with error 126 - #4869
Merged
Merged
Conversation
… load with error 126 A relinked executable that cannot load a library reports "GetLastError: 126 - The specified module could not be found.", which also covers a library whose dependent DLLs are missing. On Windows a self-built libs/ directory needs libgcc_s_seh-1.dll, libstdc++-6.dll and libwinpthread-1.dll next to it. For error 126 the stub now adds a line naming them. Refs boykopovar#4482
Contributor
|
Windows test: head AI-assisted (Claude Code). |
11 tasks done
Collaborator
|
Checked the stub change (error 126 compare reloads |
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a relinked Windows executable fails to load a library with error 126, the startup stub now prints one more line after the system message: the module or one of its dependent DLLs was not found, and a self-built
libs/also needslibgcc_s_seh-1.dll,libstdc++-6.dllandlibwinpthread-1.dllfrom the toolchain'smingw64/binnext to it.Error 126 (
The specified module could not be found.) is also what Windows reports when the library file exists but one of its dependencies is missing, which is what the reporter of #4482 hit withlibSceNpManager.prx. The existing output named only the.prx. No other error code, load path or exit code changes.The new lines sit after
writeLastError()inWindowsEntryStubBuilder.cpp; #3579 edits the same function above them (the optional-provider probe), so whichever lands second needs a small rebase.Refs #4482.
Tested
Windows 11, WinLibs GCC 15.2.0 r7, relinker-only build (
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON) onmain758aca7: 138/138 tests pass, includingwindows_import_modules, which now assertsGetLastError: 126and the hint for a missing module.tools/check_conventions.py --base origin/mainpasses. Not run with a real title.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository