feat(libSceLibcInternal): return from 52 empty facet members as firmware 13.42 does #15584
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15584"
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 BunnyFl on 2026-11-03T20:28:59Z.
What
52 libSceLibcInternal exports threw. In firmware 13.42 each one is a single
ret. They are:D1) and base-object (D2) destructors of thecodecvt,collate,messages,money_get,money_put,num_get,num_putandtime_putfacets, and ofstd::bad_exceptionandstd::type_info;_Init(const _Locinfo&)members of thecodecvt<char>,messages,money_get,money_put,num_getandnum_putfacets;_Tidy()members ofnumpunctandtime_get.They now return without reading or writing anything. Names and NIDs match
tools/nid_names.py.core/libs/prx/libSceLibcInternal/InventoryExports.cpp(39) andInventoryExports6.cpp(13)._Tidybecomevoid (void* self)._Initbecomesvoid (void* self, const void* locinfo).include/InventoryExports.hpp, changed to match. The 13 fromInventoryExports6.cpphad none, and get one each ininclude/Api.hppnext to the other implemented_nid_no_patchhelpers.docs/dev/debt/libSceLibcInternal.md:InventoryExports6.cppare removed: their gaps are closed.InventoryExports.cppand the 13.42 reading. The "Additional callable exports" entry now says every entry except those throws.This PR doesn't touch the libc facet model in
core/libs/prx/libc/src/LocaleSupport.cpp, whose_Getcatbuilds facets with its own host vtables.Source
Firmware 13.42
system/common/lib/libSceLibcInternal.sprx(sha256a01795ab49df639dd40abd6194956ada062244826824ce486c9acab227bf5285), read from disassembly, not run on a console. Each address below is the entry of the exports named beside it, and the whole body is the one instruction:No argument is read,
thisincluded, and nothing is written; theretonly returns to the caller. A null or invalid pointer is never dereferenced, here or in firmware.Tested
94d15e4116: 68 of 68 pass. That is:guest_libc_internal_empty_facet_members;guest_errandguest_libc_internal_exception_destructors, which link the same library;public_headersand the 64public_headers_compile_*batches.core/libs/tests/GuestLibcInternalEmptyFacetMembers.cpp(registered afterguest_err_testsincore/libs/prx/libSceLibcInternal/CMakeLists.txt):_Initmembers also get a 0x80-byte_Locinfostand-in filled with 0x5a.NotImplemented_nid_no_patch(__func__)back at the top of the 52 bodies, which ismain's behaviour, and kept this branch's signatures and test. The new test then aborts withlibSceLibcInternalInventory_021_nid_no_patch not implemented(1 of 1 failed).tools/check_conventions.py --base upstream/mainon the committed head94d15e4116: all checks pass.be00f1bf72, had adebt-lengthwarning (the additional exports entry reached 1364 characters). I had run the check before committing, and it reads committed Git objects (CONTRIBUTING.md, "reads pull request Git objects"), so it didn't see the debt change. The second commit moves the note into its own entry, which fixes it.tools/pr_overlap.py --branch: #13486, #13778, #13782, #14212, #14401, #14664, #14796, #14836, #14837, #14903, #14936, #15582 and #5021 share files. None of their diffs names any of these helpers or NIDs.include/Api.hpp. Whichever merges second needs a one-line rebase.main87448b3c91into the branch; the head is now99026d4f56. The only conflict was thedocs/dev/debt/libSceLibcInternal.mdinventory entry:mainhad rewritten it to exempt its two newshowmanycexports from the statement that every entry throws, so this merge takesmain's wording and widens that exemption to cover this branch's empty facet and exception members as well, keepingmain's separateshowmanycentry and this branch's "Empty facet and exception members" entry unchanged. Counted from the merged tree,InventoryExports.cppholds 288APS5_EXPORTentries, 41 of them non-throwing: this branch's 39 plusmain's twoshowmanycexports.InventoryExports6.cppkeeps this branch's 13, each with one declaration ininclude/Api.hpp.main01f804bb2fgave the head33f57566ee, where that entry recorded 288 observed entries with 282 matching the public 3.20 catalogue, against this branch's original 295 and 289.99026d4f56, Windows 11, WinLibs GCC, Release: the same 68 of 68 pass, none skipped, andtools/check_conventions.py --base upstream/mainpasses on the committed head.maincdf371df68into the branch; the head is nowb85d7c5df4.mainhad implemented_ZNSt8ios_baseD1Ev(#14664), thepmrresources (#14903) andfflush(#14872) elsewhere and removed their placeholders and per-function debt entries fromInventoryExports.cpp,InventoryExports6.cppanddocs/dev/debt/libSceLibcInternal.md. Some of those sat next to this branch's lines, so the merge conflicted in those two places and next tomain's newguest_libc_internal_memory_resourceregistration inCMakeLists.txt. Both sides' removals are kept, and both test registrations. The branch's added and removed lines againstmainare the same as before the merge.main9e47f0c3acinto the branch (aff0181145):mainhad registeredguest_libc_internal_facet_queriesand declared itsPending3/Pending4members where this branch registersguest_libc_internal_empty_facet_membersand declares its 13 members, incore/libs/prx/libSceLibcInternal/CMakeLists.txtandinclude/Api.hpp; both sides are kept.check_conventions.pywarned that the "Additional callable exports" entry (docs/dev/debt/libSceLibcInternal.md:9) was 1017 characters, over its debt-length limit, sodb42e4c5f8drops its sentence "No other runtime functionality is implemented". The head is nowdb42e4c5f8.ctest -R '^guest_libc_internal': 21 of 21 passed;sig_users.py HEAD --build: the changed declarations are named only in this branch's files.InventoryExports.cppholds 282APS5_EXPORTentries, 41 of them non-throwing (this branch's 39 andmain's twoshowmanycexports), andInventoryExports6.cpp142, 13 of them non-throwing (this branch's 13).b85d7c5df4, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 68 of 68 pass, none Not Run, the same suite as above with every executable rebuilt.tools/check_conventions.py --base upstream/mainon the committed headb85d7c5df4: all checks pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Pull request closed