feat(libc): export the collate facet vtable as data #9979

Merged
mazen320 merged 1 commit from upstream-pr/9979 into main 2026-10-24 18:34:33 +00:00
mazen320 commented 2026-10-23 02:08:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-23T02:08:34Z.


What

Export collate<char>'s vtable (NID ruZtIwbCFjk) as nine zeroed uintptr_t slots so titles that resolve it as data get a 72-byte object matching console title libc.prx (PPSA16833). Facet calls through the slots still fault until methods are wired (debt note). _Getcat still installs the host g_collateVtable for facets it builds.

Orthogonal to open facet-vtable exports (ctype #9735 / #9761, time_get #9456 / #9464, num_get #9468, num_put #9698 / #9845). Not covered by #9038 (codecvt / numpunct / time_put _Getcat). Wide follow-up can Depend on this (_ZTVSt7collateIwE, also 72 on the same libc.prx).

Tested

  • ctest --test-dir build-win -R '^guest_locale$' — passed (Windows MinGW).
  • python tools/check_conventions.py --base upstream/main — passed.
  • Console: ruZtIwbCFjk is STT_OBJECT st_size 72 in PPSA16833 sce_module/libc.prx (dynsym via PT_DYNAMIC).

Checklist

  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (libc data export)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4976754393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9979). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-23T02:08:34Z. --- ### What Export `collate<char>`'s vtable (NID `ruZtIwbCFjk`) as nine zeroed `uintptr_t` slots so titles that resolve it as data get a 72-byte object matching console title `libc.prx` (PPSA16833). Facet calls through the slots still fault until methods are wired (debt note). `_Getcat` still installs the host `g_collateVtable` for facets it builds. Orthogonal to open facet-vtable exports (`ctype` #9735 / #9761, `time_get` #9456 / #9464, `num_get` #9468, `num_put` #9698 / #9845). Not covered by #9038 (`codecvt` / `numpunct` / `time_put` `_Getcat`). Wide follow-up can Depend on this (`_ZTVSt7collateIwE`, also 72 on the same `libc.prx`). ### Tested - `ctest --test-dir build-win -R '^guest_locale$'` — passed (Windows MinGW). - `python tools/check_conventions.py --base upstream/main` — passed. - Console: `ruZtIwbCFjk` is STT_OBJECT `st_size` 72 in PPSA16833 `sce_module/libc.prx` (dynsym via PT_DYNAMIC). ### Checklist - Depends on: none - Fixes: none - Unblocks: none - GPUs tested: n/a (libc data export) - AI-assisted: yes
MarcZX10 commented 2026-10-23 04:13:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T04:13:28Z.

Review: APPROVED


Reviewed exact head 2cb1d6676a342b6a2079c26bd46d706065c82467 against current main. The change adds the char collate vtable symbol as nine uintptr_t slots (72 bytes), consistent with the reported console STT_OBJECT size, and the locale test verifies the object resolves, starts zeroed, and is writable. The unresolved virtual methods are clearly recorded in the debt note; _Getcat's host facet vtable path is unchanged. I found no duplicate export in the open PRs listed by the overlap check; shared debt/test-file edits are distinct.

I reran the convention check against current main, the exact-head test-script registration audit (171 scripts at this PR head), and git diff --check; all pass. The PR reports guest_locale passing on Windows and has successful relinker checks on Linux, Windows, macOS, and macOS x86_64. I could not run guest_locale locally because this workspace has no configured AnyPS5 build or test executable. Hosted product build jobs are skipped by policy. The review is limited to making the data symbol available with its measured size; it does not establish the console vtable's slot contents or virtual-call behavior.

No blocking issue found on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5623803184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9979#pullrequestreview-5623803184). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T04:13:28Z. **Review:** APPROVED --- Reviewed exact head 2cb1d6676a342b6a2079c26bd46d706065c82467 against current main. The change adds the char collate vtable symbol as nine `uintptr_t` slots (72 bytes), consistent with the reported console `STT_OBJECT` size, and the locale test verifies the object resolves, starts zeroed, and is writable. The unresolved virtual methods are clearly recorded in the debt note; `_Getcat`'s host facet vtable path is unchanged. I found no duplicate export in the open PRs listed by the overlap check; shared debt/test-file edits are distinct. I reran the convention check against current main, the exact-head test-script registration audit (171 scripts at this PR head), and `git diff --check`; all pass. The PR reports `guest_locale` passing on Windows and has successful relinker checks on Linux, Windows, macOS, and macOS x86_64. I could not run `guest_locale` locally because this workspace has no configured AnyPS5 build or test executable. Hosted product build jobs are skipped by policy. The review is limited to making the data symbol available with its measured size; it does not establish the console vtable's slot contents or virtual-call behavior. No blocking issue found on this head.
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!9979
No description provided.