Repository navigation
fix(relinker): relink the modules that found needed modules need - #1782
MathiasDevelopes wants to merge 1 commit into
Conversation
|
This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready. |
adriadam10
left a comment
There was a problem hiding this comment.
The rebase isn't mechanical: since this PR was opened, #1503/#1830 changed the same block of GuestModuleBuilder.cpp (needed names matched by stem/alias and by module identity, images preloaded into discovered), so both GuestModuleBuilder.cpp and test_guest_needed_modules.py conflict.
Please rebase on current main and carry the round-by-round search over the new logic: the dependencies of each module found this way must go through the same exact/stem/identity matching, each name searched once, and the parsed image still reused when the modules are relinked. Keep both new test cases (transitive, and transitive with a host library), and check they still fail without the fix.
Dean already said it passed testing; once rebased with CI green it can go in.
|
Rebuilt the PR changes on current main, preserving the newer exact-name, stem/alias and module-identity resolution already present in GuestModuleBuilder.
|
A module named by the executable's DT_NEEDED and found outside sce_module, sce_modules and prx was relinked, but the modules it needed in turn were not looked up. They were left as host libraries, which no host provides, so the title failed to load. The needed names of each module found this way are now searched for in the same way, until no new module is found; names nothing in the input provides stay host libraries. Each found module is parsed once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
8fde4cb to
d62048e
Compare
|
@oneandonlydean @adriadam10 Rebased onto current main. Since the needed-module search now also matches by stem and module identity, I moved that whole search into a step that reruns on the dependencies of each module it finds, until nothing new turns up. The first pass behaves exactly as on main. The two new tests ( |
|
Closing this one. 41126bf removed the search for modules outside sce_module/sce_modules/prx, which is the code this PR extended. Now every module directly in those folders is relinked, so a module's own dependencies are picked up when they sit there too. I checked this on current main: a module in sce_module that needs another one relinks both in the right order, and a dependency nothing provides stays a host library. If a title turns up with modules outside those folders, I'll open a new issue for it. |
What
When the executable needs a module that is not in
sce_module,sce_modulesorprx, the relinker searches the input tree for it and relinks it. The modules that this found module needs in turn were not looked up. They were left as host libraries, which no host provides, so the title failed to load.The needed names of every module found this way are now searched for the same way, round by round, until no new module turns up. Each name is searched once, so a dependency cycle ends the search. Names that nothing in the input provides stay host libraries, as before. Ambiguity, exclusion (
--exclude-sce-module) and the skipped module directories work as before. Each found module is parsed once, and the parsed image is reused when the modules are relinked.The scope is kept narrow. Only modules found by this search have their needs followed. Modules in
sce_module,sce_modulesandprxare unchanged, and their needs resolve as before.Example: Planet Coaster (PPSA01736) needs
libcohtml.Prospero.prxat the package root, and that module needslibChakraCore.prxandlibRenoirCore.PS5.prxbeside it. Before, only cohtml was relinked; now all three are.Tested
Windows 11, MinGW-w64 15.2.0.
test_guest_needed_modules.pyadds two cases, each for both Linux ELF and Windows PE output:The first case fails without the fix. The relinker-only build passes its tests (36/36), and so does the full build (476/476).
tools/check_conventions.py --base origin/mainpasses. Converting PPSA01736 now relinks cohtml, ChakraCore and RenoirCore, and the title loads them. Not built or run on Linux or macOS.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