Repository navigation
feat(libc): export the std::__sce_v2 clog, wclog and standard stream pointers - #16083
Merged
oneandonlydean merged 1 commit intoNov 6, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
…pointers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 feat(libc): export the std::__sce_v2 extended-precision helpers #15336, feat(libc): export the std::__sce_v2 multiprecision helpers #15471, feat(libc): export the std::__sce_v2 _Poly and _XLgamma helpers #15484, feat(libc): export the std::__sce_v2 _Xtime_diff_to_millis2 helper #15490, feat(libc): export the std::__sce_v2 _Exp and _FExp helpers #15501, feat(libc): export the std::__sce_v2 _Pmsw, _FPmsw and _LPmsw helpers #15519, feat(libc): throw std::bad_cast and the std::__sce_v2 bad_any_cast, format_error and future_error #15552, feat(libc): forward the std::atomic wait and notify helpers to libkernel #15561, feat(libc): count the std::__sce_v2 _Winit and ios_base::Init initializations #15602, feat(libc): export the std::__sce_v2 floating-point constants #15614, fix(libc): store the std::__sce_v2 _Throw_Cpp_error value in the first code word #15667, feat(libc): export the std::__sce_v2 _Stollx, _Stoullx, _Stolx and _Stoulx parsers #15683, feat(libc): export std::_Throw_bad_any_cast and std::_Throw_bad_node_access #15791, feat(libc): export the std::error_category complete and deleting destructors #15796, feat(libc): export the std::__sce_v2 resetiosflags, setiosflags, setbase and setprecision manipulators #15809, feat(libc): export the std::__sce_v2 _Timespec64_get_sys and _Timespec64_diff_to_ts clock helpers #15834, feat(libc): export the std::__sce_v2 at-thread-exit registry calls #15879 and feat(libc): export the remaining std::__sce_v2 facet ids and ios_base _Sync and _Index #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