feat(libc): export the wide codecvt facet vtable as data #10180

Merged
mazen320 merged 1 commit from upstream-pr/10180 into main 2026-10-24 07:21:53 +00:00
mazen320 commented 2026-10-23 12:06:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-23T12:06:49Z.


What

Export codecvt<wchar_t,char,_Mbstatet>'s vtable (NID H-TDszhsYuY) as thirteen zeroed uintptr_t slots so titles that resolve it as data get a 104-byte object matching console title libc.prx (PPSA26344) and libSceLibcInternal.sprx. Facet calls through the slots still fault until methods are wired (debt note).

The wide codecvt id is already exported; this adds the matching vtable data object. Symbols are distinct from #10165 (narrow codecvt [16]→[13] size fix, NID aK1Ymf-NhAs) and from #9038 (_Getcat for narrow codecvt / numpunct / time_put). Adjacent insert points in LocaleSupport.cpp / GuestLocale.cpp / the debt note currently conflict if the three heads are merged without an order — see Checklist.

Merge / rebase order

  1. Land #10165 first (narrow size to thirteen slots + CheckCodecvtVtableObject + narrow debt bullet).
  2. Rebase this PR onto that result; keep both [13] arrays (Icc and Iwc), both GuestLocale checks (CheckCodecvtVtableObject then CheckCodecvtWideVtableObject), and both debt bullets (narrow then wide).
  3. #9038 should rebase after those land (or after this) and keep its _Getcat / clog work; its GuestLocale insert sits next to the new checks — preserve the size/export checks when resolving.

Not a stack on #10165's commits: Depends on stays none so either size PR can land first if the resolver follows the keep-both rule above; preferred order is still #10165 → this → #9038.

Tested

  • guest_locale_tests — passed (Windows MinGW): Guest locale checks passed after adding CheckCodecvtWideVtableObject().
  • py -3.12 tools/check_conventions.py --base upstream/main — passed.
  • Console: H-TDszhsYuY is STT_OBJECT st_size 104 in PPSA26344 sce_module/libc.prx and in /system/common/lib/libSceLibcInternal.sprx (dynsym, FTP).

Checklist

  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4982469519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10180). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-23T12:06:49Z. --- ### What Export `codecvt<wchar_t,char,_Mbstatet>`'s vtable (NID `H-TDszhsYuY`) as thirteen zeroed `uintptr_t` slots so titles that resolve it as data get a 104-byte object matching console title `libc.prx` (PPSA26344) and `libSceLibcInternal.sprx`. Facet calls through the slots still fault until methods are wired (debt note). The wide `codecvt` id is already exported; this adds the matching vtable data object. Symbols are distinct from #10165 (narrow `codecvt` `[16]`→`[13]` size fix, NID `aK1Ymf-NhAs`) and from #9038 (`_Getcat` for narrow `codecvt` / `numpunct` / `time_put`). Adjacent insert points in `LocaleSupport.cpp` / `GuestLocale.cpp` / the debt note currently conflict if the three heads are merged without an order — see Checklist. **Merge / rebase order** 1. Land #10165 first (narrow size to thirteen slots + `CheckCodecvtVtableObject` + narrow debt bullet). 2. Rebase this PR onto that result; keep **both** `[13]` arrays (`Icc` and `Iwc`), **both** GuestLocale checks (`CheckCodecvtVtableObject` then `CheckCodecvtWideVtableObject`), and **both** debt bullets (narrow then wide). 3. #9038 should rebase after those land (or after this) and keep its `_Getcat` / `clog` work; its `GuestLocale` insert sits next to the new checks — preserve the size/export checks when resolving. Not a stack on #10165's commits: **Depends on** stays none so either size PR can land first if the resolver follows the keep-both rule above; preferred order is still #10165 → this → #9038. ### Tested - `guest_locale_tests` — passed (Windows MinGW): `Guest locale checks passed` after adding `CheckCodecvtWideVtableObject()`. - `py -3.12 tools/check_conventions.py --base upstream/main` — passed. - Console: `H-TDszhsYuY` is STT_OBJECT `st_size` 104 in PPSA26344 `sce_module/libc.prx` and in `/system/common/lib/libSceLibcInternal.sprx` (dynsym, FTP). ### Checklist - Depends on: none - Fixes: none - Unblocks: none - GPUs tested: n/a - AI-assisted: yes
MarcZX10 commented 2026-10-23 12:42:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T12:42:36Z.

Review: APPROVED


Re-reviewed exact head 6224ab70b9e182e919e24a6bfbb4be421cddce87. The new checklist resolves the previously identified merge integration: preferred order is #10165 → this PR → #9038, and it explicitly preserves both narrow/wide vtable exports, tests and debt bullets. The symbol and 104-byte size evidence remain distinct from #10165 and #9038. The author reports the focused guest_locale_tests pass on Windows MinGW; conventions and diff checks pass. Hosted Ubuntu/Windows/macOS arm64/x86_64 relinker, ASAN, register-context and write-watch jobs all pass on this head; Linux/Windows product jobs are skipped by path policy.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5628354251 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10180#pullrequestreview-5628354251). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T12:42:36Z. **Review:** APPROVED --- Re-reviewed exact head `6224ab70b9e182e919e24a6bfbb4be421cddce87`. The new checklist resolves the previously identified merge integration: preferred order is #10165 → this PR → #9038, and it explicitly preserves both narrow/wide vtable exports, tests and debt bullets. The symbol and 104-byte size evidence remain distinct from #10165 and #9038. The author reports the focused `guest_locale_tests` pass on Windows MinGW; conventions and diff checks pass. Hosted Ubuntu/Windows/macOS arm64/x86_64 relinker, ASAN, register-context and write-watch jobs all pass on this head; Linux/Windows product jobs are skipped by path policy.
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!10180
No description provided.