fix(libc): build the libc++ codecvt<char> test with clang #27827
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27827"
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 magnub on 2026-11-27T14:29:50Z.
What
GuestLibcxxCodecvtChar.cpp(from19a1c07a71) castcodecvtRecord.vtable[5]andguestType.vtable[5], bothconst void*, straight to theUpcastfunction pointer type. GCC accepts that; clang rejects it ("reinterpret_cast from 'const void *' to 'Upcast' ... casts away qualifiers"), soguest_libcxx_codecvt_char_testsdoes not build on macOS. Both casts now go throughconst_cast<void*>, as the merged #27320 did forGuestLibcxxRegexError.cpp. Test-only change.Tested
macOS 27.0.1 (26A434) on an Apple M1 Pro, Apple clang 21.0.0, x86_64 Release build under Rosetta 2. Build:
main2b6c1b0445plus #17425, #11049, #26739 and #25331, which the macOS build needs:guest_libcxx_codecvt_char_testsfails to build with the error above, at lines 149 and 150.guest_libcxx_codecvt_charpasses 3/3.tools/check_conventions.py --base origin/mainpasses. Log attached.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
https://claude.ai/code/session_012LL9hfx4BY6MbUCYMduDAQ
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T14:41:38Z.
Review: APPROVED
Reviewed — looks good
The change fixes the two const-qualification casts in the codecvt test; the changed lines are consistent with the described clang build issue.
What I ran
Reviewed head
24b2a7b252ccf864a6c4cd573337ccf43d5dc6a2usingrepo_read.pyto inspect the prepared diff and the complete changed file. No build or tests were run during this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported macOS build, test run, and conventions check were not independently verified. No repository files were excluded from review; the changed file
core/libs/tests/GuestLibcxxCodecvtChar.cppwas read in full.review/files.jsonwas not available in the review folder; the reader's file listing confirmed the changed-file manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T14:50:18Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
24b2a7b252:tools/check_conventions.pypassed.guest_libcxx_codecvt_char_testsbuilt cleanly.guest_libcxx_codecvt_char):Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-27T15:19:46Z.
Review: COMMENTED
Linux clang 23.1.5, x86-64, independently confirms the compiler difference. Compiling the
GuestLibcxxCodecvtChar.cpptranslation unit from base2b6c1b0445rejected both upcasts because they cast away qualifiers. The file from exact head24b2a7b252ccompiled and linked against the same locally built Linuxlibc.prx, which is unchanged in this PR. The resulting codecvt test executable passed 3/3 runs.This was a focused clang build of the test translation unit against the existing GCC-built PRX. AI-assisted.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:39:32Z.
Review: COMMENTED
The Linux libc++ codecvt fixture passed with the patched test source. This focused run used GCC, so the Clang-specific compile result is the author’s evidence.
AI-assisted: yes.