fix(relinker): search libc.prx for libkernel-only Windows executables #5990
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5990"
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 Get-fix on 2026-10-14T18:36:49Z.
What
AnyPS5 exports some libkernel functions, such as
__error, from libc.prx, which libkernel.prx links. On Linux they resolve through that dependency. On Windows the import stubs search only the modules listed for the executable, and libc.prx was listed only when libSceLibcInternal.prx was needed. PS4 homebrew built with the OpenOrbis toolchain imports__errorfrom libkernel but needs no libSceLibcInternal.prx, so the OpenOrbis samples stop at start-up withFAIL: unresolved ELF import 9BcDykPmo1I(__error). libc.prx is now also listed when libkernel.prx is needed. PS5 executables need libSceLibcInternal.prx and convert unchanged. macOS has the same gap in its own patcher; that is recorded in the relinker debt file and not changed here.Part of the PS4 homebrew work tracked in #3093.
Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, onmaine442f4c2e:windows_dependency_diagnosticscovers a libkernel-only executable; reverting the condition, or listing libc.prx twice, makes it fail.main.main84b01f9cd, all together one442f4c2e): without this change, the nine samples that otherwise start (graphics, input, pngdec, exceptions, hello_world, using_library, dialogs, audio-wav, net_http) all stop atFAIL: unresolved ELF import 9BcDykPmo1I; with it they start.tools/check_conventions.py --base origin/mainpasses.Not tested on Linux or macOS; the change is in the Windows import builder.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T13:34:59Z.
I checked the overlap the bot lists. I fetched each listed pull request and, for every file it shares with this one, merged its change with
git merge-fileinto currentmain(a5e2a80c6) and intomainwith this pull request merged. A conflict that appears only in the second case is one this pull request adds.The bot lists 22 pull requests, with 22 shared files between them. This one adds a conflict in only one:
docs/dev/debt/relinker.md, this one the macOSlibc.prxnote and #5784 its ANDN note. Keeping both lines resolves it. No code is shared.The other 21 merge the same with and without this pull request.
AI-assisted: yes (Claude Code). I ran these checks myself on Windows 11.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T18:37:08Z.
Rebased onto
main03c4cb5e7(now Get-fix/AnyPS5@8c3458759) for the needs rebase label.mainhad added an entry for the ANDN lowering at the end ofdocs/dev/debt/relinker.md, where this one adds its macOSlibc.prxentry; I kept both. The code is unchanged. In a build ofmain03c4cb5e7with my other open pull requests,windows_dependency_diagnosticsandwindows_import_modulespass, the full ctest passes except two tests this change does not touch (agc_driver_gpu_indirect_arguments_misaligned_writer_aheaddoes not compile with MinGW onmain(#6452 fixes it), andprx_thread_local_destructorsfails as it did onmain92cdc7b62on this machine without my changes), and 15 of the 16 OpenOrbis sample programs start (networkingwas not run).AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T18:50:18Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/debt/relinker.mdImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T20:07:42Z.
Checked the diff, the updated
windows_dependency_diagnosticsrows (libkernel-only, libc.prx already present, deduplicated list) and the macOS debt entry againstMacOsMachOPatcher.cpp; relinker build and ctest are green on Linux (the Windows test is registered only for WIN32, so the full Windows Build covers it). Merging once that passes.