feat(libc): implement atol and atoll #2186
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2186"
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 reyani-dev on 2026-10-09T11:07:13Z.
What
Exports
atolandatoll. FreeBSD defines them asstrtol(str, NULL, 10)andstrtoll(str, NULL, 10). The guestlongis 64 bits (asstrtol_nid_postfixalready assumes), soatolcallsstd::strtollrather than the hostatol, whoselongis 32 bits on Windows.Titles: from the #1578 audit, imported from
libSceLibcInternal(resolved throughlibc.prx):atoll(fLcU5G6Qrjs): PPSA99039 EVO Player, which stops on Windows withFAIL: unresolved ELF import fLcU5G6Qrjs from libSceLibcInternal.prx; also Stremio Plus, RetroArch, PS5MC, Porpoiseatol: PPSA74126 Stremio Plus, PPSA92280 Capy Mobile, PPSA99169 RetroArch, PPSA99420 PS5MCI haven't run any of these titles.
Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:guest_math_tests, next to thestrtolcases:-4294967296,INT64_MAX,INT64_MIN,4294967297x);"0x10"→ 0,"010"→ 10);std::atol(32-bitlongon Windows) andstrtoll(..., 0)each makeguest_mathfail.cmake --build build --target libs: the patchedlibc.prxexports+my9jdHCMIQ(atol) andfLcU5G6Qrjs(atoll).tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no overlap.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T11:07:36Z.
Progress report (
d70b899→a6f870a)📈 System libraries: 84.7% (+0.01%, +2 implemented functions)
✅ 2 implemented
atol_nid_postfixatoll_nid_postfixImported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T11:30:12Z.
Full Linux and Windows builds and tests for this head (
a6f870ae), using the project's Build workflow. I can't start the upstream manual run, so I ran the samebuild.ymlin my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into currentmain(d70b8998):ctest: 516/516 passedctest: 507/507 passedRun: https://github.com/AchrafReyani/AnyPS5/actions/runs/37921793157
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:09:51Z.
Closing: the EVO Player
atollstop is from an older main; on current main it stops at other imports first, same as #1852. Reopen whenatoloratollis a title's next stop on main, with the log line.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T02:16:33Z.
This is now a title's next stop on current
main, so here is the log line the close note asked for, plus a check of this branch.Checked
a6f870aemerged ontomainc963432d(the only conflict is inGuestMath.cpp, wheremainaddedstrtoll/_Stoulchecks next to this PR's; keeping both resolves it), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC from WinLibs), Release.guest_mathpasses 5/5 on both (--repeat until-fail:5); no CRT assertion dialog on Windows.main(catalog runs on2edaf7f4Linux and0c0dc1e9Windows) and with this branch:mainundefined symbol: fLcU5G6Qrjs(atoll)1nTKA7pN1jw(utime)undefined symbol: fLcU5G6Qrjs(atoll)1nTKA7pN1jw(utime)undefined symbol: fLcU5G6Qrjs(atoll)3QIPIh-GDjw(rewind)undefined symbol: fLcU5G6Qrjs(atoll)3QIPIh-GDjw(rewind)undefined symbol: +my9jdHCMIQ(atol)04AjkP0jO9U(_umtx_op)undefined symbol: +my9jdHCMIQ(atol)j-gWL6wDros(getifaddrs)Example lines for PSXS5 (PPSA97510):
mainWindowsFAIL: unresolved ELF import fLcU5G6Qrjs (atoll) from libSceLibcInternal.prx; with this branch, Linuxapp.elf: symbol lookup error: app.elf: undefined symbol: 1nTKA7pN1jw, WindowsFAIL: unresolved ELF import 1nTKA7pN1jw from libSceLibcInternal.prx.OpenRCT2 (PPSA99728) also reaches
atoloncellroundfexists (#2189).Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T02:25:30Z.
@oneandonlydean this now has the evidence the close note asked for, thanks to @babyhuey's run above. On current
main, PSXS5 (PPSA97510), SwanStationPS5, EVO Player and Nuvio stop atatoll, and ProsperoPuzzles and PSBox stop atatol; with this branch each moves on to its next import. OpenRCT2 reachesatolafter #2189. Could you reopen it? GitHub doesn't let me reopen a PR a maintainer closed.I rebased the branch onto current
main(96494337). The only conflict wasGuestMath.cpp, wheremainadded thestrtoll/_Stoulchecks next to these; both sets are kept.guest_mathpasses on Windows.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T18:34:33Z.
Resubmitted as #2932 now that intake allows it, rebased onto current
mainwith the title evidence above.Pull request closed