feat(libc): export the C rune locale #1781
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1781"
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 babyhuey on 2026-10-08T19:04:45Z.
What
Exports the FreeBSD C rune locale from libc:
_DefaultRuneLocale(lWGF8NHv880),_CurrentRuneLocale(chlN6g6UbGo) and__mb_sb_limit(fGYLBr2COwA). Titles built against FreeBSD<ctype.h>/<wctype.h>read_CurrentRuneLocale->__runetype[c]inline, bounded by__mb_sb_limit, and fall back to&_DefaultRuneLocale; they import these aslibSceLibcInternaldata._RuneLocalefollows FreeBSD 11include/runetype.h, checked withstatic_asserts:__runetypeat 64,__maplowerat 2112,__mapupperat 3136, ranges at 4160, 4224 bytes.lib/libc/locale/table.cfor all 256__runetype,__maplowerand__mapupperentries (compared offline against a parse of that file): ASCII classes, the digit value in the low byte of digits and hex letters, no class above 0x7f, magicRuneMagi, encodingNONE,__invalid_rune0xFFFD, empty_extranges._CurrentRuneLocalepoints at_DefaultRuneLocale, and__mb_sb_limitis 256, as in FreeBSDtable.candnone.cfor the C locale, the only localesetlocaleaccepts.Found with
tools/import_audit.pyon the catalog homebrew titles:_DefaultRuneLocaleis absent in 11 of 36 audited titles,_CurrentRuneLocaleand__mb_sb_limitin 9.Tested
Linux (Ubuntu 24.04, GCC 13, Release): new
guest_rune_localeand existingguest_localepass with--repeat until-fail:3. The test reads the export at raw FreeBSD offsets and checks every entry against the existingis*,tolowerandtoupperexports, the digit values, the header fields and__mb_sb_limit. It fails when the_CTYPE_Nbit is dropped from digits.check_conventions.pypasses. Windows: both files compile with MinGW-w64 GCC 13 (-Wall -Wextra -fsyntax-only); not run on Windows.import_audit.pywith the patched libraries, absent imports before → after: PPSA19111 66 → 63, PPSA59322 ccleste 50 → 47, PPSA68091 Ruffle 71 → 68, PPSA97510 74 → 71, PPSA98510 74 → 71, PPSA99002 74 → 71, PPSA99010 vkQuake 51 → 48, PPSA99764 80 → 77, PPSA99810 64 → 61. No title run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:45:59Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
8aa4040b, merged ontomaind70b8998in one build with 38 other PRs that had no Windows run.guest_rune_locale. None of them reported skipping a case.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:18:38Z.
Checked the NIDs against aerolib, the
_CTYPE_*bits and digit/hex values against FreeBSDrunetype.h, and the layout asserts.guest_rune_localepasses on Linux and fails to link without the change; popcoder565 also ran it on Windows. Merging.