feat(libc): implement Cnd-init, spin-lock, unexpected and std-tag exports #18122
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18122"
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 akkadbakkad89 on 2026-11-10T14:24:22Z.
What
Adds real
libc.prxexports for five named C++ runtime surfaces that titles import by symbol name:_Lock_shared_ptr_spin_lock/_Unlock_shared_ptr_spin_lock(fRWufXAccuI,1HYEoANqZ1w) - test-and-set byte with acquire/release ordering, matching the PPSA10665libc.prx(xchgloop at0x7cda0, byte-store release at0x7cdb0on the module flag at0x10669c)_Cnd_init_with_name(2B+V3qCqz4s) - delegates to_Cnd_init; the name is dropped like the sibling_Cnd_init_with_default_name_overridebecause named conditions are not modelled__cxa_call_unexpected(usKbuvy2hQg) - aliases__cxa_call_terminate; this library keeps no unexpected-handler state so every call reachesstd::terminate, the ABI end state when no handler is installedstd::tag and placeholder data exports (_ZSt10adopt_lock,_ZSt10defer_lock,_ZSt11try_to_lock,_ZSt6ignore,std::placeholders::_1.._20) as single zero bytes whose observable contract is address identity, and_ZSt14_Raise_handleras a null function pointerAll names are exported under the real firmware symbol names with
_nid_postfix, so the NID patcher derives the recorded NIDs itself. The earlier forwarding-layer approach was dropped: main already insertslibc.prxinto the import search order whenlibSceLibcInternal.prxis hosted, so these NIDs bind to real implementations without forwarders.fcloseall, the mspace heap-empty queries and the math exports were dropped from this PR's scope in favour of #11831, #10397 and #8417/#6295 respectively.Tested
Windows 11, MinGW GCC 15.2.0. New focused test
guest_libc_named_exportsexercises every added export: spin-lock acquire/release roundtrip,_Cnd_init_with_namesuccess + null-handlestd::invalid_argument, tag/placeholder address distinctness,_Raise_handler == nullptr, and__cxa_call_unexpectedresolving (fork-based SIGABRT death check on non-Windows). Fullguest_libcsuite 48/48 including allguest_libc_internal_*tests. Export presence verified in the builtlibc.prxPE export table. Not run on Linux or a console.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)