fix(relinker): start on Windows without a missing library nothing imports from #3129
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3129"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-10T22:50:26Z.
What
The Windows start-up stub stops with error 126 at the first needed library it cannot load, even when the title imports nothing from it. Road of Death and Record of Lodoss War list
libSceXml.prx; Resident Evil 4 listsParty.prx. A host library that no import is searched in is now skipped with a message when it is not found. A missing library something imports from, other load errors and guest modules still stop the start.Imports whose module matches no needed library keep their declared module name, so they count only against the library they declare. A module declared as
libGueststill keeps a missinglibGuest.xyzrequired.Closes #2591. Fixes the
Party.prxstop in #2776 (the title then stops atsetSpecialFloatFormatType, tracked there).Carried from Silverash-i8's fork branch
fix/windows-start-without-unused-library(two commits, original authorship kept); the unnamed-import rule is from xXPBSXx.Tested
Windows 11, MinGW-w64 GCC, relinker-only build (
ANYPS5_RELINKER_ONLY=ON):ctest99/99, includingwindows_import_modulesandguest_module_identity.tools/check_conventions.py --base upstream/mainpasses. Not run on a title by me; xXPBSXx reported on #2591 that Record of Lodoss War (PPSA05347) and Resident Evil 4 (PPSA07411) pass the missing-library stop with these commits (...\libs\libSceXml.prx -> not found; nothing is imported from it, continuing without it), and that PRAGMATA and Returnal are unchanged.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-10T23:24:11Z.
Review: COMMENTED
The distinction this draws is the whole change, and it is drawn correctly: a library that nothing imports from is skipped with a message, while a missing library something does import from, any other load error, and guest modules all still stop the start. Widening the skip as far as the symptom would have turned a hard failure into a silent one, and the second half — imports whose module matches no needed library keeping their declared name, so each counts only against the library it declares — is what stops that from becoming a loophole.
The titles are named, which is the bar this tree asks for, and the two cases read differently for a reason:
libSceXml.prxandParty.prxare carried dependencies the title never calls into, which is exactly the shape the fix is for.One thing checked, because it is the failure mode of this change. The skipped-library line is emitted unconditionally — only the path echo beside it sits behind
--windows-diagnostics— so a plain--windowsrun says which library was skipped and why. That is the right default: the alternative is a start that succeeds while a library quietly did not load, with nothing on screen to say so.And closing the issue it fixes, with the
Party.prxcase named, is the right way to write the description — a reader can check both titles against their own copies.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T01:08:25Z.
Please leave the needed libraries nothing imports from out of the start-up load list, instead of continuing after
LoadLibraryfails with 126 (unusedMissinginWindowsEntryStubBuilder.cpp). Carrying on after a failed load is a fallback, which isn't allowed here, and the relinker already knows which libraries those are.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-11T01:14:26Z.
Done in the latest commit: the start-up stub no longer loads needed libraries that no import is searched in, so there is no
LoadLibraryfailure path or continue-after-126 branch left. The "Searched libraries" list also omits them.windows_import_modulesnow asserts the run exits 11 without mentioning the unused library; relinkerctestpasses.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T04:29:40Z.
Windows run of the current head (
7755e1d0) merged ontomain961b25fe: Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release, relinker-only build (ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ON).ctest: 100/100 pass, includingwindows_import_modulesandguest_module_identity.--windows --registry, once with this merge and once with a relinker built frommain961b25fe. Relink results are the same: 41 succeed and 7 stop with rc 2 on both. Once the output paths are normalized, the relinker logs are identical. This was a static check only; I did not run the outputs, so it doesn't exercise the start-up skip itself.Two small things from reading the latest commit:
WindowsEntryStubBuilder.cpp:153still addsskippedModule(" -> not found; nothing is imported from it, continuing without it\n"), but after the review change nothing references it. The string is now written into every stub's data and never used.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T05:05:46Z.
A library that an import is still searched in has to stay in the load list. At
7755e1d0it doesn't when the import has no matching library:WindowsEntryStubBuilder.cpp:127marks a library only whenimport.Libraryis set, and:143only by the declared module's name, while the search order of such an import still holds every library.An executable needing
a.prx(host library inlibs/, nothing insce_module) that importsshared, orshared#A#Bwith modulelibSceJson, exits 11 onmain961b25fe. With this head it stops:Please fix that and add the case to
windows_import_modules; the three new cases pass only because their provider is a guest module, which is always loaded.skippedModule(:153) is unused now.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T05:30:06Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/domain/include/domain/GuestRuntime.hppL26Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:11:52Z.
Checked the diff, relinker build and ctest (94/94) on current main, and the Windows relinker job (
windows_import_modulesasserts exit 11 and no mention of the unused library). Libraries nothing imports from are now left out of the start-up load list, which covers Dean's request; missing libraries something imports from, other load errors and guest modules still stop the start. Merging.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T09:09:36Z.
FYI for the authors of this change (@Silverash-i8, @CnRJay): the last commit here (
7755e1d0, needed libraries nothing imports from are left out of the start-up load) breaks start-up on Hotline Miami (PPSA09682): an import without a library name (sceAppContentAddcontMount) can no longer be resolved becauselibSceAppContent.prxis no longer loaded. Bisect, evidence and a fix with a regression test are in #3367. The Party.prx case should stay working with that fix (missing library file tolerated, message restored).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-11T13:16:54Z.
Will investigate. Thanks