feat(libc): implement libc++ ios_base::failure and iostream_category #27582
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27582"
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 kiansaeidnia on 2026-11-26T18:37:24Z.
What
The RetroArch Azahar core (PPSA99169, import inventory on #5927) imports libc++
iostream_categoryandios_base::failure, which libc did not define. This PR adds:iostream_category();ios_base::failureconstructors taking aconst char*or a libc++ string plus anerror_code, its D1 and D2, its RTTI and its vtable.It builds on #27519 (libc++
system_error), whose layout, category vtable and string helpers it reuses, so this branch contains that commit too. #27519 has merged with that same commit, so the diff here is this change only and no rebase is needed. #27540 is also stacked on #27519. The two add separate blocks toStandardExceptions.cppandApi.hpp, so whichever merges second may need a textual rebase.The behaviour follows LLVM libc++ 17
ios.cpp:ios_base::failureis a libc++system_errorwith its own RTTI, whose base is thesystem_errorRTTI, and a D1, D0,whatvtable. The constructor builds thesystem_errorand then sets thefailurevtable, as a derived constructor does.what()is the message plus": "plusmessage()for a nonzero code, and the message alone for 0.iostream_categoryis namediostreamand uses theerror_categorydefault condition and equivalence. Its message isunspecified iostream_category errorfor 1 (io_errc::stream) and for values fromsys_nerron, and the gueststrerrortext otherwise, witherrnokept.A null message, error code or category throws
invalid_argument. The debt fragment records that the layout comes from libc++ 17, not from a console module, and that the cutoff uses the same unverifiedELASTof 96 as #27519.pr_overlapreports #27540, which shares the #27519 commit and adds next to it inApi.hpp, as described above. It could not compareApi.hppwith #11831, #12682, #12688, #12700, #12965, #18135, #25289 and #26224, because those PRs conflict withmain. I searched their diffs, and none addsiostream_categoryorios_base::failure.Tested
Windows 11, MinGW-w64 GCC 16.2, Release.
guest_libcxx_system_error, which now also coversios_base::failure, passes. Its failure line still namessystem_errorfor these checks.The new checks cover:
iostream_categoryRTTI, name, and messages for 1, 2, 5,sys_nerr - 1,sys_nerr,sys_nerr + 1and -1, witherrnounchanged;equivalentoverloads;failureRTTI and vtable slots;__cxa_throwof afailurecaught asruntime_errorand asexception, with__cxa_current_exception_typegiving thefailureRTTI and its base givingsystem_error.The test was syntax-checked with g++ 11 on Linux (WSL Ubuntu).
test_public_headers.py --audit-onlyanddebt_fold.py --checkpass. Not tested in the Azahar core itself.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
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T18:47:25Z.
Review: COMMENTED
Actionable comments posted: 3
71474479-ef71-48fa-8cf8-55d7774b0a2bReviewing files that changed from the base of the PR and between
68f3c9077candcf0a305f08.core/libs/prx/libc/include/Api.hppcore/libs/prx/libc/src/exception/StandardExceptions.cppcore/libs/prx/libc/tests/cmake/guest_libcxx_system_error.cmakecore/libs/tests/GuestLibcxxSystemError.cppdocs/dev/debt/changes/feat-libc-libcxx-ios-failure.mddocs/dev/debt/changes/feat-libc-libcxx-system-error.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T18:53:02Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed code is coherent on inspection, but I did not run the checks, so a formal approval is not justified.
What I ran
cf0a305f088ed6020a5f65b169793fc37878d55fusingrepo_read.py; no commands or tests were run.Api.hpp,StandardExceptions.cpp,guest_libcxx_system_error.cmake,GuestLibcxxSystemError.cpp, and both technical-debt fragments. Also read the prepared description, commits, manifest, diff, and review README.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
guest_libcxx_system_error,test_public_headers.py --audit-only, anddebt_fold.py --checkpassed, and reports a Linux syntax check; these results were not independently verified.files.jsonwas not available as a review document; the review README and manifest list six changed files, all of which I read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T07:36:06Z.
Review: APPROVED
I read the diff at
cf0a305f08. Merged intomainat35e34b1a7f0together with other open PRs (so not an isolated build), Release, on Windows 11 (GCC 15.2) and Ubuntu 24.04 under WSL2 (GCC 13.3).guest_libcxx_system_error: passes on both.guest_libcxx_*tests of that tree pass too (39 on Linux).maindoes not have.The open thread on
DeleteMessageis about a deleting destructor thatmain's other exception tables share, and #19864 changes it for all of them. The other open thread is about the test calling a slot through the guest ABI, which is what the test is for. The Windows CI job was cancelled at its 90 minutes; the Windows run above covers the libc++ tests only, not the whole suite.Not checked: a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:33:34Z.
Review: COMMENTED
Compiled the branch’s normal exception translation unit and ran
GuestLibcxxSystemErroron Linux against the existing runtime libraries. The iostream category andios_base::failurecases passed.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.