fix(relinker): resolve Windows guest filename casing #1101

Merged
eliasbruno124-dev merged 1 commit from upstream-pr/1101 into main 2026-10-08 06:43:35 +00:00
eliasbruno124-dev commented 2026-10-07 11:16:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-07T11:16:19Z.


What

DOOM + DOOM II (PPSA21444, 03.000.000) ships prx/party.prx but requests Party.prx. On Windows the relinker converts the supplied module, then incorrectly requests a separate libs/Party.prx and exits with 0xc0000135.

Resolve a Windows guest dependency by exact filename/SONAME first, then by ASCII-insensitive filename. Carry the resolved spelling into the generated loader's provider aliases. The title-supplied module remains the provider. SONAME-only aliases, symbol identities and Linux filename matching remain case-sensitive; genuinely missing imports still fail. No Sysmodule or host library behavior changes.

Rebased onto main f71bf7fd403ba955de26219b3f2cd8aad6510a64. Final commit: ba3e75a1001e6a5cec385e208330fdac973db462. The production patch is unchanged from the previously reviewed fcd5b3df. The wrong-case SONAME regression now sits beside the filename cases, leaving the existing missing-dependency block unchanged. This removes the textual test conflict with #1153 without incorporating its implementation or dropping either regression.

Tested

Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release/Ninja, Python 3.12:

  • Fresh build of the final commit: all 30 registered relinker CTest groups pass, including the newly upstreamed guest_needed_modules group; no skips. The current conventions check passes.
  • The updated Windows regression fails against main f71bf7fd with the expected missing Party.prx failure (0xc0000135). For this negative comparison, the sole changed production translation unit was compiled from exact main and relinked with the other unchanged production objects from the clean candidate build. The original candidate objects and executable were preserved.
  • The old published head conflicts with #1153 at 2236238f9b9769cf4559aee351819ffaafb250df. The updated head merges cleanly. A separate fresh build of that combination passes all 30 registered relinker groups, including both filename/SONAME and GUI failure-status cases. That integration is local only; this PR does not contain the foreign production change.
  • Converted the original DOOM executable and all seven supplied modules again with the final relinker, with no removed module or guessed provider. Native startup clears the false Party.prx dependency and stops at FAIL: unresolved ELF import 1OLgvahaSco from libSceNpWebApi2.prx (0xc0000139). Retained input hashes and the host library hashes are unchanged.

The original-title bootstrap uses the same source-built host libraries from 9a1c12f3d9e6c1e213a1adbe4901fd969a51b4be as the earlier comparison, reached through an absolute custom --rpath. Those libraries are not claimed to be current main. Historical preparation normalized SELF metadata and flattened represented module directories; the original loaded payloads and filenames are retained. Large assets were not recopied for this bootstrap retest. No menu, gameplay or frame-rate result is claimed.

This validation covers the relinker component, not a full-project build. Native Linux was not rerun for this update. The earlier independent Windows/Linux report applies to the previous fcd5b3df commit and remains historical evidence.

Reproduction:

python core/relinker/relinker/tests/test_windows_import_modules.py <relinker>
cmake --build <relinker-build> --parallel 3
ctest --test-dir <relinker-build> --output-on-failure -j 1
python tools/check_conventions.py --base f71bf7fd403ba955de26219b3f2cd8aad6510a64
relinker --windows --windows-diagnostics --to-intel --registry --rpath <unchanged-host-libs> <title>/eboot.bin <output>/game.exe

Overlap: #716 is now part of the base. #1153 changes diagnostic failure handling; it is tested separately as described above and is not a dependency. The filename correction retains the existing runtime-name initialization used by the deferred-loading work in #846. No duplicate system-library implementation is added. This follows the ownership requirements discussed in #676 and the review of #1061.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4771829109 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1101). Originally posted by [eliasbruno124-dev](https://github.com/eliasbruno124-dev) on 2026-10-07T11:16:19Z. --- ### What DOOM + DOOM II (PPSA21444, 03.000.000) ships `prx/party.prx` but requests `Party.prx`. On Windows the relinker converts the supplied module, then incorrectly requests a separate `libs/Party.prx` and exits with `0xc0000135`. Resolve a Windows guest dependency by exact filename/SONAME first, then by ASCII-insensitive filename. Carry the resolved spelling into the generated loader's provider aliases. The title-supplied module remains the provider. SONAME-only aliases, symbol identities and Linux filename matching remain case-sensitive; genuinely missing imports still fail. No Sysmodule or host library behavior changes. Rebased onto main `f71bf7fd403ba955de26219b3f2cd8aad6510a64`. Final commit: `ba3e75a1001e6a5cec385e208330fdac973db462`. The production patch is unchanged from the previously reviewed `fcd5b3df`. The wrong-case SONAME regression now sits beside the filename cases, leaving the existing missing-dependency block unchanged. This removes the textual test conflict with #1153 without incorporating its implementation or dropping either regression. ### Tested Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release/Ninja, Python 3.12: - Fresh build of the final commit: all 30 registered relinker CTest groups pass, including the newly upstreamed `guest_needed_modules` group; no skips. The current conventions check passes. - The updated Windows regression fails against main `f71bf7fd` with the expected missing `Party.prx` failure (`0xc0000135`). For this negative comparison, the sole changed production translation unit was compiled from exact main and relinked with the other unchanged production objects from the clean candidate build. The original candidate objects and executable were preserved. - The old published head conflicts with #1153 at `2236238f9b9769cf4559aee351819ffaafb250df`. The updated head merges cleanly. A separate fresh build of that combination passes all 30 registered relinker groups, including both filename/SONAME and GUI failure-status cases. That integration is local only; this PR does not contain the foreign production change. - Converted the original DOOM executable and all seven supplied modules again with the final relinker, with no removed module or guessed provider. Native startup clears the false `Party.prx` dependency and stops at `FAIL: unresolved ELF import 1OLgvahaSco from libSceNpWebApi2.prx` (`0xc0000139`). Retained input hashes and the host library hashes are unchanged. The original-title bootstrap uses the same source-built host libraries from `9a1c12f3d9e6c1e213a1adbe4901fd969a51b4be` as the earlier comparison, reached through an absolute custom `--rpath`. Those libraries are not claimed to be current main. Historical preparation normalized SELF metadata and flattened represented module directories; the original loaded payloads and filenames are retained. Large assets were not recopied for this bootstrap retest. No menu, gameplay or frame-rate result is claimed. This validation covers the relinker component, not a full-project build. Native Linux was not rerun for this update. The earlier independent Windows/Linux report applies to the previous `fcd5b3df` commit and remains historical evidence. Reproduction: ```text python core/relinker/relinker/tests/test_windows_import_modules.py <relinker> cmake --build <relinker-build> --parallel 3 ctest --test-dir <relinker-build> --output-on-failure -j 1 python tools/check_conventions.py --base f71bf7fd403ba955de26219b3f2cd8aad6510a64 relinker --windows --windows-diagnostics --to-intel --registry --rpath <unchanged-host-libs> <title>/eboot.bin <output>/game.exe ``` Overlap: #716 is now part of the base. #1153 changes diagnostic failure handling; it is tested separately as described above and is not a dependency. The filename correction retains the existing runtime-name initialization used by the deferred-loading work in #846. No duplicate system-library implementation is added. This follows the ownership requirements discussed in #676 and the review of #1061. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
ctz23 commented 2026-10-07 13:38:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ctz23 on 2026-10-07T13:38:07Z.


Independent validation of fcd5b3dff24c3547de6b16192a573eaeee4e57e0 against its parent 0d3c1eec8950e64cd9492d6c054cc620cc5d3b38:

  • Windows 11 Pro 10.0.26200, WinLibs MinGW-w64 GCC 15.2.0 UCRT POSIX SEH r7, CMake 3.28.3, Python 3.12.3: fresh Release relinker builds for both commits; all 29 registered relinker tests passed three consecutive times on each commit, with zero failures or skips.
  • Running the candidate's test_windows_import_modules.py against the parent binary reproduces 0xc0000135, trying to load the absent libs/Party.prx. The same fixture passes against the candidate binary. Its native Windows checks cover mixed-case filenames in executable and guest imports, exact SONAME precedence, wrong-provider/missing-symbol failures, and rejection of incorrectly cased SONAME-only aliases.
  • Native Linux x86_64, GCC 13.3.0, CMake 3.28.3, Python 3.12.3: fresh Release relinker builds for both commits; all 29 registered tests passed three consecutive times on each commit, with zero failures or skips.
  • Additional native Linux runtime checks pass on both binaries: an executable calls a title-supplied provider, and a guest module's initializer imports the same provider. Exact filenames and exact SONAME aliases return 22. Requests for Party.prx when the file is party.prx, and ALIAS.prx when the SONAME is alias.prx, retain those unresolved DT_NEEDED entries and fail at runtime with the expected missing-library diagnostics. Synthetic ELF input segments were aligned for the native Linux loader before conversion; generated outputs were not edited.

Scope: the relinker component and synthetic integration fixtures. The external CMake wrapper uses the unchanged project core/relinker/CMakeLists.txt and reproduces the root C++20, static-link and MinGW test-runtime settings. No full-project build, system libraries, real title/homebrew run, or GitHub Actions result is claimed. Linux cannot execute the PE fixtures; their runtime checks were performed on Windows. The candidate fixture also passes against the parent binary on Linux, so that converter-only result does not detect the original Windows runtime bug.

All four CTest suites contain the complete registered set: 348 successful executions, including 174 on the candidate. SHA256 verification matched all 49 archived Windows evidence files; both source checkouts remain clean. At inspection, current main e79c971f99acd6987b1d6545e9ba57c00b11fe04 has the same core/relinker tree as the parent above.

Validation scripts and this report were prepared with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6039156068 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1101#issuecomment-6039156068). Originally posted by [ctz23](https://github.com/ctz23) on 2026-10-07T13:38:07Z. --- Independent validation of `fcd5b3dff24c3547de6b16192a573eaeee4e57e0` against its parent `0d3c1eec8950e64cd9492d6c054cc620cc5d3b38`: - Windows 11 Pro 10.0.26200, WinLibs MinGW-w64 GCC 15.2.0 UCRT POSIX SEH r7, CMake 3.28.3, Python 3.12.3: fresh Release relinker builds for both commits; all 29 registered relinker tests passed three consecutive times on each commit, with zero failures or skips. - Running the candidate's `test_windows_import_modules.py` against the parent binary reproduces `0xc0000135`, trying to load the absent `libs/Party.prx`. The same fixture passes against the candidate binary. Its native Windows checks cover mixed-case filenames in executable and guest imports, exact SONAME precedence, wrong-provider/missing-symbol failures, and rejection of incorrectly cased SONAME-only aliases. - Native Linux x86_64, GCC 13.3.0, CMake 3.28.3, Python 3.12.3: fresh Release relinker builds for both commits; all 29 registered tests passed three consecutive times on each commit, with zero failures or skips. - Additional native Linux runtime checks pass on both binaries: an executable calls a title-supplied provider, and a guest module's initializer imports the same provider. Exact filenames and exact SONAME aliases return 22. Requests for `Party.prx` when the file is `party.prx`, and `ALIAS.prx` when the SONAME is `alias.prx`, retain those unresolved `DT_NEEDED` entries and fail at runtime with the expected missing-library diagnostics. Synthetic ELF input segments were aligned for the native Linux loader before conversion; generated outputs were not edited. Scope: the relinker component and synthetic integration fixtures. The external CMake wrapper uses the unchanged project `core/relinker/CMakeLists.txt` and reproduces the root C++20, static-link and MinGW test-runtime settings. No full-project build, system libraries, real title/homebrew run, or GitHub Actions result is claimed. Linux cannot execute the PE fixtures; their runtime checks were performed on Windows. The candidate fixture also passes against the parent binary on Linux, so that converter-only result does not detect the original Windows runtime bug. All four CTest suites contain the complete registered set: 348 successful executions, including 174 on the candidate. SHA256 verification matched all 49 archived Windows evidence files; both source checkouts remain clean. At inspection, current main `e79c971f99acd6987b1d6545e9ba57c00b11fe04` has the same `core/relinker` tree as the parent above. Validation scripts and this report were prepared with AI assistance.
adriadam10 commented 2026-10-08 06:43:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T06:43:32Z.


Checked the build and full ctest on Linux merged onto current main (419/419). The Windows job runs windows_import_modules and passes, which is where the 0xc0000135 regression is exercised. Linux filename matching and wrong-case SONAMEs still behave as before (covered by the new cases). Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6054113704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1101#issuecomment-6054113704). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T06:43:32Z. --- Checked the build and full ctest on Linux merged onto current main (419/419). The Windows job runs `windows_import_modules` and passes, which is where the `0xc0000135` regression is exercised. Linux filename matching and wrong-case SONAMEs still behave as before (covered by the new cases). Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1101
No description provided.