feat(sysmodule): map libc for libkernel #23240
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23240"
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 Thimo188 on 2026-11-18T20:52:37Z.
What
Implements
sceSysmoduleMapLibcForLibkernelfrom the PS5 and PS4 firmware readings in #21866. The export applies the preload gate, tries the application, sandbox and system libc paths in firmware order, returns the loader error after the last failure, and uses guest-safe output writes. The PS5 final-failure and not-preloaded paths write-1; the PS4 title-process path preserves the output on final failure as read from firmware.Implements the reachable PS5 side of
sceSysmodulePreloadModuleForLibkernel: it marks the relinker-provided system libraries ready so a real map call can proceed. Firmware walks 31 modules; AnyPS5 already provides those system libraries through the relinker, so it records readiness instead. The unknown PS4 preload path throws throughNotImplemented_nid_no_patch, and the substitution is recorded as technical debt.Adds focused coverage for the real PS5 preload export, invalid guest output, application, sandbox and system libc success, missing sandbox, PS5 final failure with
-1, and PS4 final failure with unchanged output.Tested
Ubuntu 24.04 amd64 Docker, GCC 13.3, Ninja, Release,
BUILD_TESTING=ON:cmake --build build-fixes --target guest_sysmodule_tests: passed.ctest --test-dir build-fixes -R "^guest_sysmodule$" --output-on-failure: 1 of 1 passed.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branch feat/sysmodule-map-libc-for-libkernel: completed; reported existing shared test/debt paths with #18184 and #22362, not duplicate export implementations.2c2670711b: passed.Not run with a title or on a PS5. No known PPSA title import has been identified, and the return values have not been measured on a console.
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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T21:03:39Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
a9278d8bd2:tools/check_conventions.pypassed.guest_sysmodule_testsbuilt cleanly.guest_sysmodule,guest_sysmodule_maps_scan):core/libs/prx/libSceSysmodule/Export.cpp,core/libs/prx/libSceSysmodule/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T06:52:14Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
a9278d8bd2da8863d540709396c163b03b7685f7. No commands or tests were run; the reported test results below are from the PR description.Results
Findings
Blocking
None.
Non-blocking
core/libs/tests/GuestSysmodule.cpp:521).Not verified
core/libs/prx/libSceSysmodule/CMakeLists.txt,core/libs/prx/libSceSysmodule/Export.cpp,core/libs/prx/libSceSysmodule/include/Api.hpp,core/libs/tests/GuestSysmodule.cpp, anddocs/dev/debt/changes/feat-sysmodule-map-libc-for-libkernel.md; all five files listed as reviewed were read. No files were excluded.To get this to a good state
Nothing is required. Optional: add tests for the fallback and PS4 failure cases when feasible.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T08:53:43Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its focused host tests support the stated behavior, with remaining firmware differences recorded as technical debt.
What I ran
Reviewed head
f33e90c4de3fb3ed4f198f1013854021d8d335aeand the prepared diff. No commands or tests were run in this review. The author reports a build, two passing CTest cases, debt and pointer audits, and a conventions check; these reports were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The run folder's
files.jsonwas not available, so I used its manifest and file listing to identify the five changed files; all five listed changed files were read. No changed files were excluded. Build and tests, runtime behavior on console, and author-reported checks were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T11:47:34Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the optional point below records a behavior gap already described in the debt note.
What I ran
Reviewed head
33103195875b87ee5e2c1f862ec0bbb1a6c6a8f6using the prepared diff and the pinned repository reader. I did not run commands or tests. The description reports its build, tests and audits; these were not independently run.Results
Findings
Blocking
None.
Non-blocking
0x5duntil another implementation sets it. The PR records this limitation in its debt fragment.Export.cpp:58Not verified
No tests, build, or physical-console behavior were run. Read all six changed files:
core/libs/prx/libSceSysmodule/CMakeLists.txt,core/libs/prx/libSceSysmodule/Export.cpp,core/libs/prx/libSceSysmodule/include/Api.hpp,core/libs/tests/GuestSysmodule.cpp,docs/dev/debt/changes/feat-sysmodule-is-called-from-sysmodule.md, anddocs/dev/debt/changes/feat-sysmodule-map-libc-for-libkernel.md. No changed paths were excluded in the manifest.To get this to a good state
Nothing is required. The optional preload follow-up is noted above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T22:06:58Z.
Review: APPROVED
Reviewed — looks good
The implementation and all six changed files were reviewed at head
2c2670711bd2705d21bd2043befc3c9bc7dd3c30; the description reports passing checks, which I did not run here.What I ran
No commands were run. I reviewed the prepared diff and the changed files through
repo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports a successful build, two passing CTest cases, and passing debt, pointer, conventions, and overlap checks; those were not run during this review. The change’s documented gaps remain: PS4 process flags and preload lists, the firmware dynlib load syscall behavior, and PS5 measurements of bad-memory and loader-failure behavior.
Read all changed files listed in
manifest.json:core/libs/prx/libSceSysmodule/CMakeLists.txt,core/libs/prx/libSceSysmodule/Export.cpp,core/libs/prx/libSceSysmodule/include/Api.hpp,core/libs/tests/GuestSysmodule.cpp,docs/dev/debt/changes/feat-sysmodule-is-called-from-sysmodule.md, anddocs/dev/debt/changes/feat-sysmodule-map-libc-for-libkernel.md. No changed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T08:31:59Z.
Review: APPROVED
Reviewed — looks good
The implementation and all six changed files were reviewed at head
bb2af93cbb366c89b97aa63fc5bb7274c63e8688; no verified blocking defect was found, and the author-reported checks were not run by this review.What I ran
Read the prepared diff and all six changed files at the pinned head. No build, test, or convention command was run.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported checks and physical PS5 behavior were not independently verified. No excluded changed files were listed.
To get this to a good state
Nothing is required.