feat(libc): export the Dinkumware _Mbrtowc and _Wcrtomb helpers #14610

Merged
edubox merged 1 commit from upstream-pr/14610 into main 2026-11-08 17:36:52 +00:00
edubox commented 2026-11-01 16:22:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-11-01T16:22:10Z.


What

libc.prx exports the Dinkumware multibyte helpers _Mbrtowc (olQf-vTaj2Q) and _Wcrtomb (6pa-Aa4kTHk); PPSA01341 imports both from it and neither was exported here. PPSA28416's relinker registry references neither NID, so this body no longer claims it.

The disassembly of PPSA28416's libc.prx (build J03848509) shows 21-byte thunks at 0xc9660 and 0xc9630 that take (wchar_t*, const char*, size_t, mbstate_t*) and (char*, wchar_t, mbstate_t*), use the C-locale conversion vector when the state is null, and forward to the same internal routines as mbrtowc and wcrtomb. This library already has guest mbrtowc and wcrtomb, so the two exports delegate to them and share their UTF-8 conversion, guest 16-bit wchar_t and thread_local state when the caller passes null. The console's _Cvtvec tables are not modelled; the debt entry records it.

This removes two of PPSA01341's eleven missing libc.prx imports (the six streams are covered by #14585, _Getctype/_Getcvt by #9466, and Need_sceLibc is not a real export).

Review evidence

On main, PPSA01341's relinker registry has both imports from libc.prx as R_X86_64_JUMP_SLOT:

Registry position (0-based) NID Call site Relocation Target
4280 olQf-vTaj2Q#u#s (_Mbrtowc) 0x1E74250 0x279E1D0 0x26D2838
4281 6pa-Aa4kTHk#u#s (_Wcrtomb) 0x1E74260 0x279E1E8 0x26D2840

nm -D on main's unpatched/libc.prx has neither symbol; this branch's has _Mbrtowc_nid_postfix and _Wcrtomb_nid_postfix. The other 29 dump registries have no entry for either NID. In the tested main build PPSA01341 runs past both imports (Demon's Souls reaches the tutorial), so there is no NotImplemented stop line for them: they are missing library exports, not the point where that title stops.

Tested

Linux x86-64 (CachyOS), GCC 16.2.1, Release:

  • ctest --test-dir build -R '^guest_multibyte_locale$' passes. The test now checks _Mbrtowc against mbrtowc for a complete form, an incomplete form and a null string/state, and _Wcrtomb against wcrtomb for a three-byte character and a null destination.
  • nid_patcher libc on the rebuilt unpatched/libc.prx exports olQf-vTaj2Q and 6pa-Aa4kTHk.
  • tools/check_conventions.py --base origin/main and git diff --check are clean; tools/pr_overlap.py --branch feat/libc-mbrtowc-helpers reports no overlap with open pull requests.

Not run on Windows or macOS, and not exercised by a title.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5109219988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14610). Originally posted by [edubox](https://github.com/edubox) on 2026-11-01T16:22:10Z. --- ### What `libc.prx` exports the Dinkumware multibyte helpers `_Mbrtowc` (`olQf-vTaj2Q`) and `_Wcrtomb` (`6pa-Aa4kTHk`); PPSA01341 imports both from it and neither was exported here. PPSA28416's relinker registry references neither NID, so this body no longer claims it. The disassembly of PPSA28416's `libc.prx` (build J03848509) shows 21-byte thunks at `0xc9660` and `0xc9630` that take `(wchar_t*, const char*, size_t, mbstate_t*)` and `(char*, wchar_t, mbstate_t*)`, use the C-locale conversion vector when the state is null, and forward to the same internal routines as `mbrtowc` and `wcrtomb`. This library already has guest `mbrtowc` and `wcrtomb`, so the two exports delegate to them and share their UTF-8 conversion, guest 16-bit `wchar_t` and `thread_local` state when the caller passes null. The console's `_Cvtvec` tables are not modelled; the debt entry records it. This removes two of PPSA01341's eleven missing `libc.prx` imports (the six streams are covered by #14585, `_Getctype`/`_Getcvt` by #9466, and `Need_sceLibc` is not a real export). ### Review evidence On `main`, PPSA01341's relinker registry has both imports from `libc.prx` as `R_X86_64_JUMP_SLOT`: | Registry position (0-based) | NID | Call site | Relocation | Target | |---|---|---|---|---| | 4280 | `olQf-vTaj2Q#u#s` (`_Mbrtowc`) | `0x1E74250` | `0x279E1D0` | `0x26D2838` | | 4281 | `6pa-Aa4kTHk#u#s` (`_Wcrtomb`) | `0x1E74260` | `0x279E1E8` | `0x26D2840` | `nm -D` on `main`'s `unpatched/libc.prx` has neither symbol; this branch's has `_Mbrtowc_nid_postfix` and `_Wcrtomb_nid_postfix`. The other 29 dump registries have no entry for either NID. In the tested main build PPSA01341 runs past both imports (Demon's Souls reaches the tutorial), so there is no `NotImplemented` stop line for them: they are missing library exports, not the point where that title stops. ### Tested Linux x86-64 (CachyOS), GCC 16.2.1, Release: - `ctest --test-dir build -R '^guest_multibyte_locale$'` passes. The test now checks `_Mbrtowc` against `mbrtowc` for a complete form, an incomplete form and a null string/state, and `_Wcrtomb` against `wcrtomb` for a three-byte character and a null destination. - `nid_patcher libc` on the rebuilt `unpatched/libc.prx` exports `olQf-vTaj2Q` and `6pa-Aa4kTHk`. - `tools/check_conventions.py --base origin/main` and `git diff --check` are clean; `tools/pr_overlap.py --branch feat/libc-mbrtowc-helpers` reports no overlap with open pull requests. Not run on Windows or macOS, and not exercised by a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 16:44:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T16:44:24Z.

Review: COMMENTED


Reviewed — looks good

The two new helpers delegate to the existing multibyte conversions; I found no blocker in the changed files, but hosted checks are queued, so this is a comment rather than an approval.

What I ran

Reviewed head 30046dcc3f2c15932d69b4e351cb21e22ca40316 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958; the merge preview is clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ test was run.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...30046dcc3f2c15932d69b4e351cb21e22ca40316
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14610
python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 30046dcc3f2c15932d69b4e351cb21e22ca40316 --json
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestMultibyteLocale.cpp

Results

Check Result Note
Diff and conventions passed No whitespace errors; convention and PR-template checks passed.
Merge preview passed Clean against the current base.
Export audit passed Both new declarations and definitions match the NIDs stated in the PR.
Test registration passed Existing CMake target and CTest entry verified.
Test-quality helper not run The detached precheck snapshot lacked the helper; the workspace heuristic warning is a false positive.
Hosted checks not run Required checks are queued on this head.
C++ test and negative control not run They require the exact-head test binary.
Precheck and focused-check output
Precheck report table (check | status):
build_and_compile | not_applicable
diff_check | passed
conventions_and_pr_template | passed
changed_export_abi_audit | failed
python_syntax | not_applicable
related_python_unit_tests | not_applicable
python_test_registration | not_applicable
live_dependency_and_mergeability_check | passed
build_dependent_cpp_tests | not_applicable
test_quality_heuristics | failed
negative_controls | not_applicable

Precheck stderr (ABI helper):
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14610-30046dcc3f2c/head-30046dcc3f2c-0c5b7564/tools/pr_abi_audit.py': [Errno 2] No such file or directory

Precheck stderr (test-quality helper):
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14610-30046dcc3f2c/head-30046dcc3f2c-0c5b7564/tools/pr_test_quality.py': [Errno 2] No such file or directory

Focused ABI audit records selected from its JSON output:
{"name":"_Mbrtowc_nid_postfix","computed_nid":"olQf-vTaj2Q","declarations":["core/libs/prx/libc/include/Api.hpp"],"definitions":["core/libs/prx/libc/src/Multibyte.cpp"],"explicit_aliases":[],"version":"not encoded by these source declarations; not verified"}
{"name":"_Wcrtomb_nid_postfix","computed_nid":"6pa-Aa4kTHk","declarations":["core/libs/prx/libc/include/Api.hpp"],"definitions":["core/libs/prx/libc/src/Multibyte.cpp"],"explicit_aliases":[],"version":"not encoded by these source declarations; not verified"}
Audit status from JSON: passed_with_warnings; other warnings are for pre-existing symbols unrelated to this diff.

Workspace test-quality heuristic:
{"findings":[{"path":"core/libs/tests/GuestMultibyteLocale.cpp","line":1,"kind":"possible-unregistered-cpp-test","message":"Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."}],"negative_control_candidates":[],"limits":["Heuristics can miss weak assertions and can flag valid tests; inspect every finding.","A test that passes against base is not by itself proof that the PR test is inadequate.","Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."]}

Negative control

Not run: the changed C++ test needs a built executable, which was outside this no-build review.

Findings

Blocking: None found in the changed implementation, declarations, test, or debt entry.

Non-blocking: The PR description reports Linux test and NID-patcher results; I did not independently rerun those build-dependent checks. The new test compares wrappers against the existing functions they delegate to, which checks forwarding behavior but is not an independent console-behavior oracle.

Sources

Not verified

The reported Linux CTest run, rebuilt PRX/NID output, other operating systems, console behavior, full build, and queued hosted checks were not verified here.

To get this to a good state

No change is needed from this review. Once hosted checks finish, I will re-check their results; if the head changes, I will rerun the applicable checks on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729172121 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14610#pullrequestreview-5729172121). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T16:44:24Z. **Review:** COMMENTED --- # Reviewed — looks good The two new helpers delegate to the existing multibyte conversions; I found no blocker in the changed files, but hosted checks are queued, so this is a comment rather than an approval. ## What I ran Reviewed head `30046dcc3f2c15932d69b4e351cb21e22ca40316` against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`; the merge preview is clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ test was run. ```sh git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...30046dcc3f2c15932d69b4e351cb21e22ca40316 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14610 python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 30046dcc3f2c15932d69b4e351cb21e22ca40316 --json python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestMultibyteLocale.cpp ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace errors; convention and PR-template checks passed. | | Merge preview | passed | Clean against the current base. | | Export audit | passed | Both new declarations and definitions match the NIDs stated in the PR. | | Test registration | passed | Existing CMake target and CTest entry verified. | | Test-quality helper | not run | The detached precheck snapshot lacked the helper; the workspace heuristic warning is a false positive. | | Hosted checks | not run | Required checks are queued on this head. | | C++ test and negative control | not run | They require the exact-head test binary. | <details><summary>Precheck and focused-check output</summary> ```text Precheck report table (check | status): build_and_compile | not_applicable diff_check | passed conventions_and_pr_template | passed changed_export_abi_audit | failed python_syntax | not_applicable related_python_unit_tests | not_applicable python_test_registration | not_applicable live_dependency_and_mergeability_check | passed build_dependent_cpp_tests | not_applicable test_quality_heuristics | failed negative_controls | not_applicable Precheck stderr (ABI helper): /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14610-30046dcc3f2c/head-30046dcc3f2c-0c5b7564/tools/pr_abi_audit.py': [Errno 2] No such file or directory Precheck stderr (test-quality helper): /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14610-30046dcc3f2c/head-30046dcc3f2c-0c5b7564/tools/pr_test_quality.py': [Errno 2] No such file or directory Focused ABI audit records selected from its JSON output: {"name":"_Mbrtowc_nid_postfix","computed_nid":"olQf-vTaj2Q","declarations":["core/libs/prx/libc/include/Api.hpp"],"definitions":["core/libs/prx/libc/src/Multibyte.cpp"],"explicit_aliases":[],"version":"not encoded by these source declarations; not verified"} {"name":"_Wcrtomb_nid_postfix","computed_nid":"6pa-Aa4kTHk","declarations":["core/libs/prx/libc/include/Api.hpp"],"definitions":["core/libs/prx/libc/src/Multibyte.cpp"],"explicit_aliases":[],"version":"not encoded by these source declarations; not verified"} Audit status from JSON: passed_with_warnings; other warnings are for pre-existing symbols unrelated to this diff. Workspace test-quality heuristic: {"findings":[{"path":"core/libs/tests/GuestMultibyteLocale.cpp","line":1,"kind":"possible-unregistered-cpp-test","message":"Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."}],"negative_control_candidates":[],"limits":["Heuristics can miss weak assertions and can flag valid tests; inspect every finding.","A test that passes against base is not by itself proof that the PR test is inadequate.","Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."]} ``` </details> ## Negative control Not run: the changed C++ test needs a built executable, which was outside this no-build review. ## Findings **Blocking:** None found in the changed implementation, declarations, test, or debt entry. **Non-blocking:** The PR description reports Linux test and NID-patcher results; I did not independently rerun those build-dependent checks. The new test compares wrappers against the existing functions they delegate to, which checks forwarding behavior but is not an independent console-behavior oracle. ## Sources - [New wrapper implementations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/30046dcc3f2c15932d69b4e351cb21e22ca40316/core/libs/prx/libc/src/Multibyte.cpp#L157-L163) - [New declarations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/30046dcc3f2c15932d69b4e351cb21e22ca40316/core/libs/prx/libc/include/Api.hpp#L818-L821) - [Existing multibyte test registration at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/f2d874c1fdccf781c0fa5d86619bb5dd8894b958/core/libs/prx/libc/CMakeLists.txt#L443-L447) ## Not verified The reported Linux CTest run, rebuilt PRX/NID output, other operating systems, console behavior, full build, and queued hosted checks were not verified here. ## To get this to a good state No change is needed from this review. Once hosted checks finish, I will re-check their results; if the head changes, I will rerun the applicable checks on the new head.
CnRJay commented 2026-11-01 19:48:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:48:54Z.

Review: COMMENTED


Withdrawn. There is no NotImplemented stop line at these imports: on main PPSA01341 runs past them. They are missing exports, not the point where the title stops.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729920554 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14610#pullrequestreview-5729920554). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:48:54Z. **Review:** COMMENTED --- Withdrawn. There is no `NotImplemented` stop line at these imports: on `main` PPSA01341 runs past them. They are missing exports, not the point where the title stops.
XairRrR commented 2026-11-03 10:03:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T10:03:26Z.

Review: APPROVED


Reviewed — approved

_Mbrtowc and _Wcrtomb forward directly to this library's mbrtowc and wcrtomb. The merged tree builds, the focused tests pass, and the changed test fails to link without the production change.

What I ran

Head b1f186162fa3cee1cddc967235ee4a4f78a65c6d, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged with --no-ff (tree 982f09119533ed9f5adc34c991ca53ab22dc67aa). Debian 13 VM, GCC 14.2.0, Release, Ninja, BUILD_TESTING=ON.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...b1f186162fa3cee1cddc967235ee4a4f78a65c6d
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(guest_multibyte_locale|guest_wide_conversion|guest_locale|public_headers)$"
# negative control
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:core/libs/prx/libc/src/Multibyte.cpp > core/libs/prx/libc/src/Multibyte.cpp
ninja -C build -j32 -l32 guest_multibyte_locale_tests
git show 982f09119533ed9f5adc34c991ca53ab22dc67aa:core/libs/prx/libc/src/Multibyte.cpp > core/libs/prx/libc/src/Multibyte.cpp
ninja -C build -j32 -l32 guest_multibyte_locale_tests
ctest --test-dir build --output-on-failure -R "^guest_multibyte_locale$"
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Build (script, merged tree) ok
Selected tests (script) no new failures and no timeouts. The 9 known failures also fail on main. guest_net_ctl is skipped on main too.
guest_multibyte_locale, guest_wide_conversion, guest_locale passed (about 0.01 s each)
public_headers passed (61 s; this is the Python header-audit test this change touches, not the new test)
Worktree after restore clean (git status --porcelain empty)

Negative control

I restored core/libs/prx/libc/src/Multibyte.cpp from main and rebuilt guest_multibyte_locale_tests. The test executable no longer links:

Link output
FAILED: tests/guest_multibyte_locale_tests
GuestMultibyteLocale.cpp:(.text.startup+0xab7): undefined reference to `_Mbrtowc_nid_postfix'
/usr/bin/ld: GuestMultibyteLocale.cpp:(.text.startup+0xb85): undefined reference to `_Wcrtomb_nid_postfix'
collect2: error: ld returned 1 exit status

After I restored the merged file, it rebuilds and passes. This confirms the link failure B-Howell reported on Windows/WSL. Because the new functions only forward to existing ones, a link failure is the only failure a revert can produce.

Findings

Blocking

None.

Non-blocking

  • The debt entry describes console behaviour before the gap (docs/dev/debt/libc.md:312). CONTRIBUTING asks an entry to "state the gap first". Right now the entry first lists the console signatures and the 21-byte thunks, and only ends with what is not modelled (_Cvtvec tables, non-C locales). I suggest starting with that gap. B-Howell's PPSA08329 disassembly shows that in that build _Mbrtowc/_Wcrtomb call mbrtowc/wcrtomb directly. If you add that, the entry can be cut to what is still unverified, namely the PPSA28416 thunks' C-locale _Cvtvec path.
  • The new test only checks forwarding (core/libs/tests/GuestMultibyteLocale.cpp:136-157). It compares each wrapper with the function it calls, as MarcZX10 already noted. This is acceptable for a pure delegation. It is not an independent check of console behaviour.

Not verified

  • I did not check behaviour on the console or in a title (PPSA01341). I did not have the dumps' libc.prx disassembly or registries, so the NIDs, the thunk addresses and the PPSA08329 findings come from the description and the discussion.
  • I did not run nid_patcher on the rebuilt libc.prx.
  • I did not build on Windows or macOS.
  • The Vulkan validation comparison was skipped because no AGC, shader or VideoOut file changed.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5750252307 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14610#pullrequestreview-5750252307). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T10:03:26Z. **Review:** APPROVED --- # Reviewed — approved `_Mbrtowc` and `_Wcrtomb` forward directly to this library's `mbrtowc` and `wcrtomb`. The merged tree builds, the focused tests pass, and the changed test fails to link without the production change. ## What I ran Head `b1f186162fa3cee1cddc967235ee4a4f78a65c6d`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged with `--no-ff` (tree `982f09119533ed9f5adc34c991ca53ab22dc67aa`). Debian 13 VM, GCC 14.2.0, Release, Ninja, `BUILD_TESTING=ON`. ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...b1f186162fa3cee1cddc967235ee4a4f78a65c6d python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(guest_multibyte_locale|guest_wide_conversion|guest_locale|public_headers)$" # negative control git show 4f41f4c375f5abb487dbd184fbc150f31994d762:core/libs/prx/libc/src/Multibyte.cpp > core/libs/prx/libc/src/Multibyte.cpp ninja -C build -j32 -l32 guest_multibyte_locale_tests git show 982f09119533ed9f5adc34c991ca53ab22dc67aa:core/libs/prx/libc/src/Multibyte.cpp > core/libs/prx/libc/src/Multibyte.cpp ninja -C build -j32 -l32 guest_multibyte_locale_tests ctest --test-dir build --output-on-failure -R "^guest_multibyte_locale$" git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Build (script, merged tree) | ok | | Selected tests (script) | no new failures and no timeouts. The 9 known failures also fail on `main`. `guest_net_ctl` is skipped on `main` too. | | `guest_multibyte_locale`, `guest_wide_conversion`, `guest_locale` | passed (about 0.01 s each) | | `public_headers` | passed (61 s; this is the Python header-audit test this change touches, not the new test) | | Worktree after restore | clean (`git status --porcelain` empty) | ## Negative control I restored `core/libs/prx/libc/src/Multibyte.cpp` from `main` and rebuilt `guest_multibyte_locale_tests`. The test executable no longer links: <details><summary>Link output</summary> ``` FAILED: tests/guest_multibyte_locale_tests GuestMultibyteLocale.cpp:(.text.startup+0xab7): undefined reference to `_Mbrtowc_nid_postfix' /usr/bin/ld: GuestMultibyteLocale.cpp:(.text.startup+0xb85): undefined reference to `_Wcrtomb_nid_postfix' collect2: error: ld returned 1 exit status ``` </details> After I restored the merged file, it rebuilds and passes. This confirms the link failure B-Howell reported on Windows/WSL. Because the new functions only forward to existing ones, a link failure is the only failure a revert can produce. ## Findings ### Blocking None. ### Non-blocking - **The debt entry describes console behaviour before the gap** (`docs/dev/debt/libc.md:312`). CONTRIBUTING asks an entry to "state the gap first". Right now the entry first lists the console signatures and the 21-byte thunks, and only ends with what is not modelled (`_Cvtvec` tables, non-C locales). I suggest starting with that gap. B-Howell's PPSA08329 disassembly shows that in that build `_Mbrtowc`/`_Wcrtomb` call `mbrtowc`/`wcrtomb` directly. If you add that, the entry can be cut to what is still unverified, namely the PPSA28416 thunks' C-locale `_Cvtvec` path. - **The new test only checks forwarding** (`core/libs/tests/GuestMultibyteLocale.cpp:136-157`). It compares each wrapper with the function it calls, as MarcZX10 already noted. This is acceptable for a pure delegation. It is not an independent check of console behaviour. ## Not verified - I did not check behaviour on the console or in a title (PPSA01341). I did not have the dumps' `libc.prx` disassembly or registries, so the NIDs, the thunk addresses and the PPSA08329 findings come from the description and the discussion. - I did not run `nid_patcher` on the rebuilt `libc.prx`. - I did not build on Windows or macOS. - The Vulkan validation comparison was skipped because no AGC, shader or VideoOut file changed. <!-- anyps5-bots job=2193 head=b1f186162fa3cee1cddc967235ee4a4f78a65c6d -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14610
No description provided.