fix(relinker): rebase guest runpaths from their output directories #1822

Merged
eliasbruno124-dev merged 1 commit from upstream-pr/1822 into main 2026-10-10 04:41:34 +00:00
eliasbruno124-dev commented 2026-10-08 20:33:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-08T20:33:25Z.


What

Linux guest modules always received a run path rebased by two parent directories. That works for app0/sce_module, but a required module emitted under app0/Media/Modules searches app0/libs instead of the executable's libs directory. A module from the game root overshoots in the other direction.

Rebase $ORIGIN paths from each emitted module's actual directory to the executable directory. Preserve the configured suffix and leave absolute paths unchanged. Discovery, original game files and Windows import resolution are unchanged.

The regression converts fixtures with providers at the input root, in sce_module, and at two deeper nonstandard paths. Each conversion also includes a standard-directory module, so modules at different depths must resolve the same configured host-library directory. It checks default, bare $ORIGIN, custom paths containing a space, and absolute paths, with separate input and output directories.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Release, ANYPS5_RELINKER_ONLY=ON, based directly on main 4b6ab6bb7371869f85837ff824f409b49f1e8081:

  • The same regression fails on unchanged main with nine incorrect resolutions and passes with the fix for all 32 module/path combinations.
  • Final relinker build, conventions and git diff --check pass. All 36 groups other than tls_function_coverage pass within 30 seconds, including the new guest_runpath group.
  • The initial full suite passed 36/37 and timed out the unchanged TLS group at 30 seconds. That complete group passes separately on both unchanged main and the final candidate. Its runtime exceeds 30 seconds on this machine; no repository timeout was raised, and these diagnostics do not establish CI's time limit.
  • Generated Linux ELF dynamic strings are inspected on Windows. No Linux host execution, game startup or performance result is claimed.

Upstream CI at this exact head passes the Linux and Windows full builds/tests and the relinker jobs on Linux, Windows and macOS. This supplements the local Windows checks above; it is not a title-playability result.

Reviewed related #732, #1165/#1232, #716 and the open discovery changes; none implements this path-depth correction. Trial merges against the inspected heads of #846, #1462, #1503, #1506, #1529, #1597, #1617, #1782 and #1815 are clean. None is included or required.

Overlap rechecked on October 9 against main f1451396: this branch merges cleanly with main. #2001 removes relinker test registrations and changes guest output-directory construction, causing conflicts in the CMake registration and module builder. It does not implement this per-module runpath rebasing and is not included or required. Whichever branch lands later needs conflict resolution.

Checklist

  • Based on current main; no other inspected open PR implements this correction
  • One topic per PR
  • No code comments added
  • Unsupported paths still fail; no silent stubs
  • No investigation files, proprietary inputs or images added to the repository
  • No new third-party code
  • Generic behavior
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4792464681 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1822). Originally posted by [eliasbruno124-dev](https://github.com/eliasbruno124-dev) on 2026-10-08T20:33:25Z. --- ### What Linux guest modules always received a run path rebased by two parent directories. That works for `app0/sce_module`, but a required module emitted under `app0/Media/Modules` searches `app0/libs` instead of the executable's `libs` directory. A module from the game root overshoots in the other direction. Rebase `$ORIGIN` paths from each emitted module's actual directory to the executable directory. Preserve the configured suffix and leave absolute paths unchanged. Discovery, original game files and Windows import resolution are unchanged. The regression converts fixtures with providers at the input root, in `sce_module`, and at two deeper nonstandard paths. Each conversion also includes a standard-directory module, so modules at different depths must resolve the same configured host-library directory. It checks default, bare `$ORIGIN`, custom paths containing a space, and absolute paths, with separate input and output directories. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, Release, `ANYPS5_RELINKER_ONLY=ON`, based directly on main `4b6ab6bb7371869f85837ff824f409b49f1e8081`: - The same regression fails on unchanged main with nine incorrect resolutions and passes with the fix for all 32 module/path combinations. - Final relinker build, conventions and `git diff --check` pass. All 36 groups other than `tls_function_coverage` pass within 30 seconds, including the new `guest_runpath` group. - The initial full suite passed 36/37 and timed out the unchanged TLS group at 30 seconds. That complete group passes separately on both unchanged main and the final candidate. Its runtime exceeds 30 seconds on this machine; no repository timeout was raised, and these diagnostics do not establish CI's time limit. - Generated Linux ELF dynamic strings are inspected on Windows. No Linux host execution, game startup or performance result is claimed. [Upstream CI at this exact head](https://github.com/boykopovar/AnyPS5/actions/runs/37840342766) passes the Linux and Windows full builds/tests and the relinker jobs on Linux, Windows and macOS. This supplements the local Windows checks above; it is not a title-playability result. Reviewed related #732, #1165/#1232, #716 and the open discovery changes; none implements this path-depth correction. Trial merges against the inspected heads of #846, #1462, #1503, #1506, #1529, #1597, #1617, #1782 and #1815 are clean. None is included or required. Overlap rechecked on October 9 against main `f1451396`: this branch merges cleanly with main. #2001 removes relinker test registrations and changes guest output-directory construction, causing conflicts in the CMake registration and module builder. It does not implement this per-module runpath rebasing and is not included or required. Whichever branch lands later needs conflict resolution. ### Checklist - [x] Based on current `main`; no other inspected open PR implements this correction - [x] One topic per PR - [x] No code comments added - [x] Unsupported paths still fail; no silent stubs - [x] No investigation files, proprietary inputs or images added to the repository - [x] No new third-party code - [x] Generic behavior - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 04:18:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T04:18:31Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#2545 core/relinker/relinker/tests/test_guest_runpath.py
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6093688061 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1822#issuecomment-6093688061). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T04:18:31Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2545 | | | `core/relinker/relinker/tests/test_guest_runpath.py` |
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!1822
No description provided.