feat(libSceNgs2): build libSceNgs2 from the libSceNgs2.native implementation #962

Merged
JAB-dev merged 1 commit from upstream-pr/962 into main 2026-10-07 02:13:08 +00:00
JAB-dev commented 2026-10-06 20:25:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-06T20:25:22Z.


What

#247 reduced libSceNgs2 to APS5_DUMMY_FUN, following the review in #228: "if a game imports libSceAjm, it also imports libSceAjm.native … In the case of Font, a game was indeed found that only loads one of them." NGS2 is such a case.

  • A title can list libSceNgs2.prx in DT_NEEDED without libSceNgs2.native.prx. PPSA22520 does, while importing libSceSaveData.native.prx and libSceSaveDataDialog.native.prx under their .native names.
  • Its NGS2 imports then bind to the dummy, and startup fails with FAIL: unresolved ELF import i0VnXM-C9fc (sceNgs2SystemRender).
  • Quake II PS5 hit the same in #451, which shared the implementation through a CMake function. Its author closed it without review.

This follows the Font precedent:

  • libSceNgs2.native/Ngs2Library.cmake defines add_sce_ngs2_library(target) with the source list, include directories, atrac9 link and visibility settings, as FontLibrary.cmake does for libSceFont and libSceFont.native.
  • Both modules call it, and libSceNgs2/Export.cpp (the dummy) is removed.
  • ngs2_core_render runs the render suite against libSceNgs2 to show the unsuffixed module loads and renders. The other suites stay on .native, since the code is the same.
  • On Windows a title importing the same function through both names would get two separate NGS2 states. No title doing that is known.

Tested

  • Windows 11, WinLibs GCC 15.2.0 r7, Release. ngs2_core_render and the .native suites pass. Both PRX files are NID-patched.
  • Full ctest on this branch alone (on top of main): 358/358. savedata_memory_metadata, which this PR doesn't touch, failed once under -j4 and passed on three reruns, as it does on main.
  • Seen in PPSA22520 (Animal Well): its NGS2 imports resolve against libSceNgs2.prx and startup continues to the next missing pieces.
  • Linux not tested.
  • #959 and #960 add NGS2 sources to the list this PR moves into Ngs2Library.cmake, so whichever merges second needs a one-line rebase.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4764244055 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/962). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-06T20:25:22Z. --- ### What #247 reduced `libSceNgs2` to `APS5_DUMMY_FUN`, following the review in #228: "if a game imports libSceAjm, it also imports libSceAjm.native … In the case of Font, a game was indeed found that only loads one of them." NGS2 is such a case. - A title can list `libSceNgs2.prx` in `DT_NEEDED` without `libSceNgs2.native.prx`. PPSA22520 does, while importing `libSceSaveData.native.prx` and `libSceSaveDataDialog.native.prx` under their `.native` names. - Its NGS2 imports then bind to the dummy, and startup fails with `FAIL: unresolved ELF import i0VnXM-C9fc` (`sceNgs2SystemRender`). - Quake II PS5 hit the same in #451, which shared the implementation through a CMake function. Its author closed it without review. This follows the Font precedent: - `libSceNgs2.native/Ngs2Library.cmake` defines `add_sce_ngs2_library(target)` with the source list, include directories, `atrac9` link and visibility settings, as `FontLibrary.cmake` does for `libSceFont` and `libSceFont.native`. - Both modules call it, and `libSceNgs2/Export.cpp` (the dummy) is removed. - `ngs2_core_render` runs the render suite against `libSceNgs2` to show the unsuffixed module loads and renders. The other suites stay on `.native`, since the code is the same. - On Windows a title importing the same function through both names would get two separate NGS2 states. No title doing that is known. ### Tested - Windows 11, WinLibs GCC 15.2.0 r7, Release. `ngs2_core_render` and the `.native` suites pass. Both PRX files are NID-patched. - Full ctest on this branch alone (on top of `main`): 358/358. `savedata_memory_metadata`, which this PR doesn't touch, failed once under `-j4` and passed on three reruns, as it does on `main`. - Seen in PPSA22520 (Animal Well): its NGS2 imports resolve against `libSceNgs2.prx` and startup continues to the next missing pieces. - Linux not tested. - #959 and #960 add NGS2 sources to the list this PR moves into `Ngs2Library.cmake`, so whichever merges second needs a one-line rebase. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-07 00:44:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T00:44:32Z.


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
#1020 core/libs/prx/libSceNgs2.native/CMakeLists.txt L1-20
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028334177 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/962#issuecomment-6028334177). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T00:44:32Z. --- <!-- 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 | |---|---|---|---| | #1020 | `core/libs/prx/libSceNgs2.native/CMakeLists.txt` [L1-20](https://github.com/boykopovar/AnyPS5/blob/66e0a1e9c56161cfda9b7f660718a0d7e5d06b7c/core/libs/prx/libSceNgs2.native/CMakeLists.txt#L1-L20) | | |
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!962
No description provided.