Repository navigation
feat(libc): add missing Unity IL2CPP runtime imports and Dinkumware helpers - #4164
Conversation
|
Hi @adriadam10 @oneandonlydean, Following up on the deduplication approach discussed in #3648, this PR implements the remaining
Whenever you have a chance, would appreciate your review! |
Progress report (0214069 → 8652dbe)📈 System libraries: 88.16% (+0.01%, +4 implemented, +3 declared, -4 removed functions) ✅ 4 implemented
⚪ 2 behaviourally empty (constant return or throw)
🆕 3 declared as stubs
🗑️ 4 removed
|
6bcd42c to
18f73a1
Compare
18f73a1 to
bad26bb
Compare
bad26bb to
78d59c3
Compare
|
Two more things before this can go in:
|
|
Thanks for the review @oneandonlydean! I've addressed all points in commit aa27a61:
I've also updated the unit tests ( |
|
I checked the PS5 SDK implementation of Export I tested a local The current diff here relocates No game files or captured binaries are included. Investigation and tests were assisted by Codex. |
|
Linux build (Arch, GCC 16.2.1, Release, On Windows |
|
The linker failure reported above is a real portability blocker for this PR: the non-Windows branch leaves |
f6edec1 to
c95bdab
Compare
|
@nicolasfalesy @MarcZX100 Thanks for the diagnosis and discussion! I have addressed both the link-time blocker and the post-patching symbol resolution in commit c95bdab:
|
|
|
c95bdab to
fb15159
Compare
|
@oneandonlydean Thanks for the architectural guidance! I've updated the implementation accordingly (commit
|
Only _Dtest, the _Inf data object and the libc++abi __function_type_info shim are taken; the libc _Pad/_Thrd_id/_Addstd/_Cnd_signal/type_info vtables/Backtrace stubs and the libSceAmpr deletions are dropped as our tree already implements them. Adds an _Inf test and rewrites the debt line to cite Dinkumware xdtest.c/xvalues.c/ymath.h.
fb15159 to
341b1c4
Compare
|
@adriadam10 @oneandonlydean Rebased onto current |
…elpers Add missing libc.prx symbols required by Unity IL2CPP runtime: - Implement _Dtest double classification in Math.cpp - Implement _Inf double constant in Math.cpp - Implement sceLibcBacktraceGetBufferSize and sceLibcBacktraceSelf in Backtrace.cpp - Implement _Cnd_signal in Threads.cpp - Implement _ZNSt8ios_base7_AddstdEPS_ in RuntimeSupport.cpp - Implement __pointer_type_info and __function_type_info vtables in TypeInfo.cpp - Remove duplicate stubs from libSceAmpr/Export.cpp - Add unit tests in GuestMath.cpp and GuestLibcThreads.cpp - Document unverified behaviors in docs/dev/debt/libc.md
341b1c4 to
8652dbe
Compare
|
@adriadam10 @oneandonlydean Rebased onto current main again |
|
Please update the description to what this branch does now: the |
|
Thanks @oneandonlydean! I have updated the PR description to accurately reflect what the branch does now:
|
What
During the boot sequence of Unity IL2CPP titles such as God of War: Sons of Sparta (PPSA28997),
eboot.elfand guest modules (Il2cppUserAssemblies.prx,lib_burst_generated.prx,PS5Util.prx, etc.) statically import Dinkumware and libc runtime symbols fromlibc.prx.This branch implements the missing Dinkumware, backtrace, and RTTI typeinfo imports in
libc.prx, and deduplicates overlapping stubs previously placed inlibSceAmpr:core/libs/prx/libc/src/Math.cpp):b-xTWRgI1qw->_Dtest: Dinkumware double floating-point classification matching_FDtest(finite -1, denormal -2, zero 0, infinite 1, NaN 2).HIhqigNaOns->_Inf: Dinkumware CRT double infinity constant.core/libs/prx/libc/src/Backtrace.cpp):sMko2YZqDNQ->sceLibcBacktraceGetBufferSize: calculates required buffer size for call stack frames.MTnuKt7HiN0->sceLibcBacktraceSelf: captures stack frames into caller buffer using host backtrace (RtlCaptureStackBackTraceon Windows,backtrace/dladdron Linux).core/libs/prx/libc/src/Threads.cpp):0uuqgRz9qfo->_Cnd_signal: wakes one waiter on condition variable.core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/prx/libc/src/exception/TypeInfo.cpp):LTov9gMEqCU->_ZNSt8ios_base7_AddstdEPS_: no-op standard stream registration helper.aeHxLWwq0gQ->_ZTVN10__cxxabiv119__pointer_type_infoE: RTTI vtable for pointer types.CSEjkTYt5dw->_ZTVN10__cxxabiv120__function_type_infoE: RTTI vtable for function types.core/libs/prx/libSceAmpr/Export.cpp):NotImplementedstubs that shadowedaeHxLWwq0gQandCSEjkTYt5dw.core/libs/tests/GuestMath.cpp(CheckDoubleClassification) andcore/libs/tests/GuestLibcThreads.cpp(ConditionSignal).docs/dev/debt/libc.md.Status of PPSA28997 Imports
Imports resolved by this PR from
libc.prx:b-xTWRgI1qw(_Dtest)HIhqigNaOns(_Inf)sMko2YZqDNQ(sceLibcBacktraceGetBufferSize)MTnuKt7HiN0(sceLibcBacktraceSelf)0uuqgRz9qfo(_Cnd_signal)LTov9gMEqCU(_ZNSt8ios_base7_AddstdEPS_)aeHxLWwq0gQ(_ZTVN10__cxxabiv119__pointer_type_infoE)CSEjkTYt5dw(_ZTVN10__cxxabiv120__function_type_infoE)Imports exported only from
libSceAmpronmain:The following symbols required by PPSA28997 are implemented in
libSceAmpronmain(via #3743 / #3558). Because they are not exported fromlibc.prx, direct imports of them fromlibc.prxstill fail unless redirected or addressed in follow-up work:dGYo9mE8K2A(_ZNSt4_PadC2Ev)gjLRZgfb3i0(_ZNSt4_PadD2Ev)xZqiZvmcp9k(_ZNSt4_Pad7_LaunchEPP7pthread)a-z7wxuYO2E(_ZNSt4_Pad8_ReleaseEv)np6xXcXEnXE(_Thrd_id)W0j6vCxh9Pc(_ZSt16_Throw_Cpp_errori)Changes from Earlier Revisions
As requested during review:
std::_Padhelpers (_ZNSt4_Pad*),_Thrd_id,_Thrd_join, and_Throw_Cpp_errorwere dropped fromlibcto avoid duplicate exports withlibSceAmprmerged in feat(libSceAmpr): implement the std::_Pad thread launch helpers #3743.guest_libc_backtracetest target were removed.docs/dev/debt/libc.md.Tested
guest_math_testsandguest_libc_threads_testspass (100%).python tools/check_conventions.py --base origin/mainpasses with 0 errors.git diff --check origin/mainclean.guest_math_testsandguest_libc_threads_testspass.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)