feat(libSceCesCs): build libSceCesCs-module from the libSceCesCs source #5425

Merged
SandstromPL merged 1 commit from upstream-pr/5425 into main 2026-10-13 22:14:20 +00:00
SandstromPL commented 2026-10-13 19:27:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-13T19:27:18Z.


What

Titles that import the character conversion library under its module name need libSceCesCs-module.prx, and nothing built it. Two reporters copied libSceCesCs.prx under that name:

  • Call of Duty: Black Ops (PPSA34501). Its bring-up discussion #5389 lists the step "Also copy libSceCesCs.prx as libSceCesCs-module.prx: the title imports Ces under that module name and the build does not make that file."
  • Void Terrarium (PPSA03061, #5055). amiraction0938 found that the game's libs/ search list references libSceCesCs-module.prx, and continued with a copy of the library under that name.

The Teardown report (PPSA15246, #3701) lists imports of the module named libSceCesCs-module too.

libSceCesCs-module is a system library that the title lists as needed. It is not a module the title ships, so it is never in sce_module/ (the point raised on #3824). The relinker keeps that needed name and binds the Ces imports to it. ImportModule ignores -module only to match an import's declared module (libSceCesCs) to that dependency, as it does for libSceFont-module.prx. So the loader looks for libSceCesCs-module.prx.

#3824 first added this target. adriadam10 asked to "show that PPSA15246 (or another title) loads libSceCesCs-module, with a test that uses the target, or drop it", and it was dropped. This PR brings it back with the reports above and a test that uses it.

Both libraries are now built from the same source by add_sce_ces_library (libSceCesCs/CesLibrary.cmake). This follows libSceFont-module (#139) and libScePsml (#2412):

  • libSceCesCs-module/CMakeLists.txt includes that file.
  • The libs target builds and NID-patches the new directory like every other one.
  • tools/progress.py counts it as sharing libSceCesCs's sources.
  • guest_ces_module runs the existing GuestCes.cpp against libSceCesCs-module.

Renaming such a needed library to its base library in the relinker would be an alternative. This PR keeps the per-library pattern of #139 and #2412.

@alexpournaras, @amiraction0938: if you can, please check that your title loads the built libSceCesCs-module.prx without the manual copy.

Tested

Ubuntu 24.04, GCC 13.3, Release with BUILD_TESTING=ON, on main dacd78525. Locally, the libusb lines were removed from CMakeLists.txt, because the libusb submodule isn't checked out here.

  • With only the test added, guest_ces_module fails to link on main: cannot find -llibSceCesCs-module. With the change, guest_ces and guest_ces_module pass, 3 runs out of 3.
  • On main, no libs/libSceCesCs-module.prx is produced. With the change it is. After nid_patcher, it exports the same 5 NIDs as libSceCesCs.prx, with SONAME libSceCesCs-module.prx.
  • tests/PatchedLibraries.cpp, the source of the patched_libraries test, opens the patched libc.prx, libkernel.prx, libSceCesCs.prx and libSceCesCs-module.prx with RTLD_NOW: 4 loaded, 0 failed. The patched_libraries test itself needs every library, and libSceUsbd doesn't build here without the libusb submodule.
  • tools/progress.py --compare against main: System libraries +0.0%, and libSceCesCs-module is listed as sharing libSceCesCs's sources.
  • Not built on Windows or macOS. The Windows PATH line for the test is the one guest_ces uses.
  • No title was run here. p3n1cillin ran Void Terrarium (PPSA03061, their own dump) on Windows with main dacd78525 plus this PR, #5153, #5140, #5219 and #5155 (#5055 comment). ZiDCxUUGbec (sceCesUcsProfileInitSJis1997Cp932) resolves from libSceCesCs-module.prx, and the game reaches its title screen. With #5153 alone it still stops on unresolved ELF import ZiDCxUUGbec.
  • #5153 (open) changes libSceCesCs/Export.cpp, GuestCes.cpp and the CesCs debt file. It merges cleanly with this, and its new export then lands in both libraries.
  • tools/check_conventions.py from main passes with this title and body.

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 (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA34501 #5389 (removes the manual copy listed under its "How to run it"; the discussion reports that main c422b57fb stops at start-up and does not name the stop). Also Void Terrarium PPSA03061 (issue #5055, no Game bring-up discussion), confirmed by p3n1cillin: with #5153 its ZiDCxUUGbec import resolves only through this PR. It also needs #5140 and #5219 to reach its title screen; #5155 was not needed for start-up.
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code); I reviewed and tested every line

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4848367992 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5425). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-13T19:27:18Z. --- ### What Titles that import the character conversion library under its module name need `libSceCesCs-module.prx`, and nothing built it. Two reporters copied `libSceCesCs.prx` under that name: - Call of Duty: Black Ops (PPSA34501). Its bring-up discussion #5389 lists the step "Also copy `libSceCesCs.prx` as `libSceCesCs-module.prx`: the title imports Ces under that module name and the build does not make that file." - Void Terrarium (PPSA03061, #5055). amiraction0938 found that the game's `libs/` search list references `libSceCesCs-module.prx`, and continued with a copy of the library under that name. The Teardown report (PPSA15246, #3701) lists imports of the module named `libSceCesCs-module` too. `libSceCesCs-module` is a system library that the title lists as needed. It is not a module the title ships, so it is never in `sce_module/` (the point raised on #3824). The relinker keeps that needed name and binds the Ces imports to it. `ImportModule` ignores `-module` only to match an import's declared module (`libSceCesCs`) to that dependency, as it does for `libSceFont-module.prx`. So the loader looks for `libSceCesCs-module.prx`. #3824 first added this target. adriadam10 asked to "show that PPSA15246 (or another title) loads `libSceCesCs-module`, with a test that uses the target, or drop it", and it was dropped. This PR brings it back with the reports above and a test that uses it. Both libraries are now built from the same source by `add_sce_ces_library` (`libSceCesCs/CesLibrary.cmake`). This follows `libSceFont-module` (#139) and `libScePsml` (#2412): - `libSceCesCs-module/CMakeLists.txt` includes that file. - The `libs` target builds and NID-patches the new directory like every other one. - `tools/progress.py` counts it as sharing `libSceCesCs`'s sources. - `guest_ces_module` runs the existing `GuestCes.cpp` against `libSceCesCs-module`. Renaming such a needed library to its base library in the relinker would be an alternative. This PR keeps the per-library pattern of #139 and #2412. @alexpournaras, @amiraction0938: if you can, please check that your title loads the built `libSceCesCs-module.prx` without the manual copy. ### Tested Ubuntu 24.04, GCC 13.3, Release with `BUILD_TESTING=ON`, on `main` dacd78525. Locally, the libusb lines were removed from `CMakeLists.txt`, because the libusb submodule isn't checked out here. - With only the test added, `guest_ces_module` fails to link on `main`: `cannot find -llibSceCesCs-module`. With the change, `guest_ces` and `guest_ces_module` pass, 3 runs out of 3. - On `main`, no `libs/libSceCesCs-module.prx` is produced. With the change it is. After `nid_patcher`, it exports the same 5 NIDs as `libSceCesCs.prx`, with SONAME `libSceCesCs-module.prx`. - `tests/PatchedLibraries.cpp`, the source of the `patched_libraries` test, opens the patched `libc.prx`, `libkernel.prx`, `libSceCesCs.prx` and `libSceCesCs-module.prx` with `RTLD_NOW`: 4 loaded, 0 failed. The `patched_libraries` test itself needs every library, and `libSceUsbd` doesn't build here without the libusb submodule. - `tools/progress.py --compare` against `main`: System libraries +0.0%, and `libSceCesCs-module` is listed as sharing `libSceCesCs`'s sources. - Not built on Windows or macOS. The Windows `PATH` line for the test is the one `guest_ces` uses. - No title was run here. p3n1cillin ran Void Terrarium (PPSA03061, their own dump) on Windows with `main` dacd78525 plus this PR, #5153, #5140, #5219 and #5155 ([#5055 comment](https://github.com/boykopovar/AnyPS5/issues/5055#issuecomment-6154121860)). `ZiDCxUUGbec` (`sceCesUcsProfileInitSJis1997Cp932`) resolves from `libSceCesCs-module.prx`, and the game reaches its title screen. With #5153 alone it still stops on `unresolved ELF import ZiDCxUUGbec`. - #5153 (open) changes `libSceCesCs/Export.cpp`, `GuestCes.cpp` and the CesCs debt file. It merges cleanly with this, and its new export then lands in both libraries. - `tools/check_conventions.py` from `main` passes with this title and body. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA34501 #5389 (removes the manual copy listed under its "How to run it"; the discussion reports that `main` c422b57fb stops at start-up and does not name the stop). Also Void Terrarium PPSA03061 (issue #5055, no Game bring-up discussion), confirmed by p3n1cillin: with #5153 its `ZiDCxUUGbec` import resolves only through this PR. It also needs #5140 and #5219 to reach its title screen; #5155 was not needed for start-up. - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code); I reviewed and tested every line 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-13 19:28:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T19:28:05Z.


Progress report (dacd785 → 299a736)

➖ System libraries: 88.15% (+0.0%)

🔗 1 now sharing sources
Library Name
libSceCesCs-module libSceCesCs
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6153465854 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5425#issuecomment-6153465854). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T19:28:05Z. --- <!-- progress-report --> ### Progress report (dacd785 → 299a736) ➖ **System libraries**: 88.15% (+0.0%) <details> <summary>🔗 1 now sharing sources</summary> | Library | Name | | - | - | | libSceCesCs-module | `libSceCesCs` | </details>
p3n1cillin commented 2026-10-13 20:04:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T20:04:40Z.


Confirmed on Void Terrarium (PPSA03061): with this PR plus #5153, ZiDCxUUGbec (sceCesUcsProfileInitSJis1997Cp932) resolves from libSceCesCs-module.prx and the game boots further. Details in https://github.com/boykopovar/AnyPS5/issues/5055#issuecomment-6154121860

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6154122996 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5425#issuecomment-6154122996). Originally posted by [p3n1cillin](https://github.com/p3n1cillin) on 2026-10-13T20:04:40Z. --- Confirmed on Void Terrarium (PPSA03061): with this PR plus #5153, `ZiDCxUUGbec` (`sceCesUcsProfileInitSJis1997Cp932`) resolves from `libSceCesCs-module.prx` and the game boots further. Details in https://github.com/boykopovar/AnyPS5/issues/5055#issuecomment-6154121860
SandstromPL commented 2026-10-13 20:11:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-13T20:11:40Z.


Thanks for testing it on your own dump, and for tracing the whole chain in #5055. That answers the "show a title loads libSceCesCs-module" condition from #3824. I've added your run to the description.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6154250899 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5425#issuecomment-6154250899). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-13T20:11:40Z. --- Thanks for testing it on your own dump, and for tracing the whole chain in #5055. That answers the "show a title loads `libSceCesCs-module`" condition from #3824. I've added your run to the description.
alexpournaras commented 2026-10-13 22:14:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alexpournaras on 2026-10-13T22:14:15Z.


Confirmed with Call of Duty: Black Ops (PPSA34501). With this PR the build now makes libSceCesCs-module.prx itself, so the manual copy is no longer needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156327408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5425#issuecomment-6156327408). Originally posted by [alexpournaras](https://github.com/alexpournaras) on 2026-10-13T22:14:15Z. --- Confirmed with [Call of Duty: Black Ops (PPSA34501)](https://github.com/boykopovar/AnyPS5/discussions/5389). With this PR the build now makes libSceCesCs-module.prx itself, so the manual copy is no longer needed.
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!5425
No description provided.