feat(libc): export the std::__sce_v2 clog, wclog and standard stream pointers #16083
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16083"
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 Danigamer05 on 2026-11-05T16:03:06Z.
What
Export the versioned
std::__sce_v2clogandwclogand the eight standard stream pointers from libc._ZNSt8__sce_v28_Ptr_cinE0JbUOAJmBDA0x197840_ZNSt8__sce_v29_Ptr_coutEaHPbwpOzg7A0x197848_ZNSt8__sce_v29_Ptr_cerrEYpXm9hJ+Kxk0x197850_ZNSt8__sce_v29_Ptr_clogE6JHYSZ5l0K40x197858_ZNSt8__sce_v29_Ptr_wcinE4vGo180IRx80x197860_ZNSt8__sce_v210_Ptr_wcoutEsK-ozcyfXlA0x197868_ZNSt8__sce_v210_Ptr_wcerrE70AJso+2Yks0x197870_ZNSt8__sce_v210_Ptr_wclogEVLb2-jScg6o0x197878_ZNSt8__sce_v24clogEtIpEi4OinAI0x198880_ZNSt8__sce_v25wclogEQtsIfGDk6wY0x198CE0The behavior comes from the
libc.prxbundled with PPSA03671 v01.001.005 (J03848509, SHA-256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6).In the module
clogandwclogare0x68-byte streams beside the other six, and each_Ptr_*is an 8-byte pointer that the stream's static constructor sets to the stream's address when the module loads. The same constructors tiecin,cerr,wcinandwcerrto their output stream and setunitbufoncerrandwcerr.Main already exports the other six versioned streams as zeroed
0x400storage, which nothing constructs.clogandwclogare added the same way next to them, and each pointer is initialized to its stream's storage, so it holds the value the console's holds after load. The tie andunitbufare not set, since there is no constructed stream to set them on; a new debt entry records this.Tested
Windows x86-64, WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON, main4741457fed4. Exact tested commit:fedacbcaedf.guest_sce_v2_localeandguest_localepass, as doespublic_headerson an earlier base.guest_sce_v2_localenow covers eight streams instead of six. It checks that each starts zeroed, that no two share storage, and that each_Ptr_*points at its own stream._Ptr_coutwas pointed atcerr, then_Ptr_wclogwas set to null. The test failed on each. The source was then restored byte for byte (SHA-256 checked) and rebuilt, and the test passed again.git diff --checkpass.tools/pr_overlap.pyread 1,848 open PRs at the tested commit and reports no overlap. It keeps exit 2 for 36 branches that already conflict with main. Merging each of the 36 with this branch and with main usinggit merge-treegives the same conflict blocks. No open PR adds these names or NIDs. The debt entry was placed where it added no conflict with any of the 144 open PRs that toucheddocs/dev/debt/libc.mdat an earlier base, and none conflicts at the tested commit. The branch also merges cleanly with #15336, #15471, #15484, #15490, #15501, #15519, #15552, #15561, #15602, #15614, #15667, #15683, #15791, #15796, #15809, #15834, #15879 and #15923.Not tested: Linux, macOS, another SDK, a game, GPU or console. No game compatibility claim. No original module, extracted bytes, harness or log is committed or uploaded.
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