feat(libc): export the ctype facet vtable as data #9735
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9735"
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 mazen320 on 2026-10-22T10:53:40Z.
What
Export
ctype<char>'s vtable (NIDGKWcAz6-G7k) as fourteen zeroeduintptr_tslots so titles that resolve it as data get a 112-byte object matching console titlelibc.prx(PPSA16833). Facet calls through the slots still fault until methods are wired (debt note). Orthogonal to #9466 (_Getctypehelpers).Open #8880 and #9038 also edit
GuestLocale.cppnear the same insert points; they do not export_ZTVSt5ctypeIcE. Prefer landing this first so those PRs rebase over the new test/debt lines (they compose by retaining both). Not a stack: Depends on stays none. Wide follow-up is #9761 (`Depends on: noneTested
ctest --test-dir build-win -R guest_locale— passed (Windows MinGW) after rebase ontoupstream/mainb7d1d47a5.python tools/check_conventions.py --base upstream/main— passed.GKWcAz6-G7kis STT_OBJECTst_size112 in PPSA16833sce_module/libc.prx(dynsym).Checklist
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T13:06:31Z.
Review: APPROVED
Checked against main
3ca07d086dand ps5-payload-dev/sdk sce_stubs/libSceLibcInternal.c:_ZTVSt5ctypeIcEis.type ..., @objectin the SDK table (L11778-11780), and the NID calculator givesGKWcAz6-G7k, so exporting it as data is correct. It is not exported on main yet._Incref/_Decref(the same order asGuestLocale::FacetVtable), and the eightctype<char>virtuals (do_tolower,do_toupper,do_widen,do_narrow, each in a single-character and a range form). It follows the zeroed codecvt/num_put arrays at LocaleSupport.cpp:298/300 and records the placeholder in the debt file.NotImplemented_nid_no_patchwould make a facet use fail with a named error.none(as you changed it on #9456 and #9698) unless there is a Game Bring-up stop to link.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-22T14:57:35Z.
Rebased onto current
main(b7d1d47a5);guest_localeand conventions still pass. Landing order with #9761: this char ctype PR first, then the wide one (Depends on: #9735there).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T15:09:41Z.
Review: DISMISSED
The implementation is supported by the cited console object size and the test checks that the export is present, zero-initialized, and writable. I found no code defect.
I reviewed the rebased head
2c5483eb02be1365fafed2145f3b55b4bb30b5e7based on currentmain(b7d1d47a5). Locally,g++ -std=c++20 -fsyntax-only -Icore/libs core/libs/prx/libc/src/LocaleSupport.cppand the same command forcore/libs/tests/GuestLocale.cpppassed;git diff --checkandpython3 tools/check_conventions.py --base upstream/main --head refs/review/pr9735also passed. I could not run the linkedguest_localeruntime test because this checkout has no configured build. The reported Windowsguest_localerun after rebase is author-reported.The current overlap report still lists open #8880 and #9038 for shared insertion points in
GuestLocale.cpp, but this PR’s checklist saysDepends on: none. CONTRIBUTING requires agreeing the order with authors of open overlapping PRs and recording the dependency. Please confirm the intended order with those authors and update the checklist (or explain why the refreshed overlap is no longer applicable). The nearby #9761 order is already documented in your comment.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-22T15:15:39Z.
Updated the body for the overlap report: #8880 / #9038 share
GuestLocale.cppinsert points only (no_ZTVSt5ctypeIcE). Prefer this landing first so they rebase over the new check/debt lines; not stacking, so Depends on stays none. #9761 already recordsDepends on: #9735for the wide ctype follow-up. Head remains onmainb7d1d47a5withguest_locale+ conventions green.