feat(libc): implement 16-bit wide string concatenation #4122
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4122"
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 MiniRML on 2026-10-11T23:46:38Z.
What
Provide the missing wcscat/wcsncat exports using the existing 16-bit guest wchar ABI. Concatenation copies code units unchanged, returns the original destination, and wcsncat appends a terminator even when its count limits the source.
These exports (wcscat, wcsncat) are named in the pinned symbol database used by AnyPS5's
tools/nid_names.py. They are absent from the base implementation. The complete changed-file scan of 370 open PRs found no other added implementation of these exports. Related functions are kept together in one topic.Sources and compatibility
The guest ABI follows the existing libc implementation: 16-bit wide code units, 64-bit long/intmax types, and x87 extended precision in 16-byte storage where used. PS5 hardware validation was not performed. Math exports that delegate to host libm do not establish bit-for-bit agreement with the console's libm; their tested behavior and that limitation are stated here.
Tested
Windows 11, MinGW-w64 GCC 15.2.0, CMake 4.3.1, Ninja, Release,
BUILD_TESTING=ON. Tested commit8f0eced3e0b4f7f3cddca1e14f35c4494a23112d, based on upstreambab7b3285221495463a4a2494dc410cf137b4a92.cmake --build build --target libc guest_libc_wide_concatenation_tests -j 8passed.ctest --test-dir build -R '^guest_libc_wide_concatenation$' --output-on-failure --no-tests=errorpassed (one behavioral regression test, multiple assertions).bab7b3285(HostPollundeclared). Upstream fixed it in merged #4021; the follow-up combined full build below passed.Checklist
Follow-up combined validation
Updated this branch to upstream
bca7a29d259299aaa8972c94d12694232bb3bb08without changing this topic's tested libc or regression source files. Current PR head:013f1b8fc23e37e2c3f4da6e058505758d7b0aa9; independent tested head:8f0eced3e0b4f7f3cddca1e14f35c4494a23112d.All 19 independent topics were then merged together on that upstream base in validation commit
f1721a1c6caebf3a95bdf312d06dbf2de7f938c0(saved in the fork undervalidation/libc-library-batch-2026-10-11):cmake --build build --target all libs -j 8passed on Windows 11.The earlier full-suite investigation remains paused. Linux runtime and PS5 hardware validation were not performed.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T23:47:02Z.
Progress report (
bca7a29→013f1b8)📈 System libraries: 86.48% (+0.01%, +2 implemented functions)
✅ 2 implemented
wcscat_nid_postfixwcsncat_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T05:25:19Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/CMakeLists.txtL80Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:26:07Z.
Closing: no title is shown to reach
wcscatorwcsncaton main; they come from the symbol database, and library functions go in when a title stops at them. Reopen with the title ID and the log line.Pull request closed