feat(libc): add missing Unity IL2CPP runtime imports and Dinkumware helpers #4164

Merged
hamb3r merged 1 commit from upstream-pr/4164 into main 2026-10-13 21:45:32 +00:00
hamb3r commented 2026-10-12 00:18:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-12T00:18:44Z.


What

During the boot sequence of Unity IL2CPP titles such as God of War: Sons of Sparta (PPSA28997), eboot.elf and guest modules (Il2cppUserAssemblies.prx, lib_burst_generated.prx, PS5Util.prx, etc.) statically import Dinkumware and libc runtime symbols from libc.prx.

This branch implements the missing Dinkumware, backtrace, and RTTI typeinfo imports in libc.prx, and deduplicates overlapping stubs previously placed in libSceAmpr:

  • Math classification and constants (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.
  • Backtrace inspection (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 (RtlCaptureStackBackTrace on Windows, backtrace/dladdr on Linux).
  • Dinkumware condition variable signaling (core/libs/prx/libc/src/Threads.cpp):
    • 0uuqgRz9qfo -> _Cnd_signal: wakes one waiter on condition variable.
  • Runtime support & C++ ABI type info (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.
  • libSceAmpr deduplication (core/libs/prx/libSceAmpr/Export.cpp):
    • Removed duplicate NotImplemented stubs that shadowed aeHxLWwq0gQ and CSEjkTYt5dw.
  • Tests & Technical Debt:
    • Added unit test cases to core/libs/tests/GuestMath.cpp (CheckDoubleClassification) and core/libs/tests/GuestLibcThreads.cpp (ConditionSignal).
    • Recorded unverified double classification behavior in 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 libSceAmpr on main:

The following symbols required by PPSA28997 are implemented in libSceAmpr on main (via #3743 / #3558). Because they are not exported from libc.prx, direct imports of them from libc.prx still 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:

  • The std::_Pad helpers (_ZNSt4_Pad*), _Thrd_id, _Thrd_join, and _Throw_Cpp_error were dropped from libc to avoid duplicate exports with libSceAmpr merged in #3743.
  • The custom backtrace frame layout and guest_libc_backtrace test target were removed.
  • Technical debt documentation is placed in docs/dev/debt/libc.md.

Tested

  • Windows 10, GCC 15.2.0 (MinGW64), Ninja:
    • guest_math_tests and guest_libc_threads_tests pass (100%).
    • python tools/check_conventions.py --base origin/main passes with 0 errors.
    • git diff --check origin/main clean.
  • Linux (Docker: Arch Linux GCC 16.2.1 & Ubuntu 22.04 LTS GCC 11.4):
    • Full project build (all 3115 targets) compiles and links cleanly.
    • guest_math_tests and guest_libc_threads_tests pass.
  • GitHub Actions CI: all checks passing on macOS, Ubuntu, and Windows.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823460246 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-12T00:18:44Z. --- ### What During the boot sequence of Unity IL2CPP titles such as *God of War: Sons of Sparta* (PPSA28997), `eboot.elf` and guest modules (`Il2cppUserAssemblies.prx`, `lib_burst_generated.prx`, `PS5Util.prx`, etc.) statically import Dinkumware and libc runtime symbols from `libc.prx`. This branch implements the missing Dinkumware, backtrace, and RTTI typeinfo imports in `libc.prx`, and deduplicates overlapping stubs previously placed in `libSceAmpr`: - **Math classification and constants** (`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. - **Backtrace inspection** (`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 (`RtlCaptureStackBackTrace` on Windows, `backtrace`/`dladdr` on Linux). - **Dinkumware condition variable signaling** (`core/libs/prx/libc/src/Threads.cpp`): - `0uuqgRz9qfo` -> `_Cnd_signal`: wakes one waiter on condition variable. - **Runtime support & C++ ABI type info** (`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. - **libSceAmpr deduplication** (`core/libs/prx/libSceAmpr/Export.cpp`): - Removed duplicate `NotImplemented` stubs that shadowed `aeHxLWwq0gQ` and `CSEjkTYt5dw`. - **Tests & Technical Debt**: - Added unit test cases to `core/libs/tests/GuestMath.cpp` (`CheckDoubleClassification`) and `core/libs/tests/GuestLibcThreads.cpp` (`ConditionSignal`). - Recorded unverified double classification behavior in `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 `libSceAmpr` on `main`: The following symbols required by PPSA28997 are implemented in `libSceAmpr` on `main` (via #3743 / #3558). Because they are not exported from `libc.prx`, direct imports of them from `libc.prx` still 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: - The `std::_Pad` helpers (`_ZNSt4_Pad*`), `_Thrd_id`, `_Thrd_join`, and `_Throw_Cpp_error` were dropped from `libc` to avoid duplicate exports with `libSceAmpr` merged in #3743. - The custom backtrace frame layout and `guest_libc_backtrace` test target were removed. - Technical debt documentation is placed in `docs/dev/debt/libc.md`. ### Tested - Windows 10, GCC 15.2.0 (MinGW64), Ninja: - `guest_math_tests` and `guest_libc_threads_tests` pass (100%). - `python tools/check_conventions.py --base origin/main` passes with 0 errors. - `git diff --check origin/main` clean. - Linux (Docker: Arch Linux GCC 16.2.1 & Ubuntu 22.04 LTS GCC 11.4): - Full project build (all 3115 targets) compiles and links cleanly. - `guest_math_tests` and `guest_libc_threads_tests` pass. - GitHub Actions CI: all checks passing on macOS, Ubuntu, and Windows. ### Checklist - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
hamb3r commented 2026-10-12 00:25:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-12T00:25:52Z.


Hi @adriadam10 @oneandonlydean,

Following up on the deduplication approach discussed in #3648, this PR implements the remaining libc.prx static imports required by the Unity IL2CPP runtime (God of War: Sons of Sparta, PPSA28997):

  • Canonical placement in libc: As noted during #3648 review, Dinkumware thread helpers (std::_Pad, _Cnd_signal, etc.) belong in libc where Unity titles actually import them from, rather than libSceAmpr (as done in #3743 / #3742). Duplicate stubs in libSceAmpr have been removed.
  • Scope: Covers _Dtest, _Inf, sceLibcBacktrace*, _ZNSt4_Pad*, _Cnd_signal, _Thrd_id, _Thrd_join, _ZSt16_Throw_Cpp_errori, _Addstd, and C++ ABI RTTI vtables. sinhf is intentionally excluded as it is tracked in #3725.
  • Verification: Full guest test coverage (guest_math, guest_libc_threads, guest_libc_backtrace) passes (100%), and tools/check_conventions.py passes with 0 errors.

Whenever you have a chance, would appreciate your review!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115581237 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6115581237). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-12T00:25:52Z. --- Hi @adriadam10 @oneandonlydean, Following up on the deduplication approach discussed in #3648, this PR implements the remaining `libc.prx` static imports required by the Unity IL2CPP runtime (*God of War: Sons of Sparta*, PPSA28997): - **Canonical placement in `libc`**: As noted during #3648 review, Dinkumware thread helpers (`std::_Pad`, `_Cnd_signal`, etc.) belong in `libc` where Unity titles actually import them from, rather than `libSceAmpr` (as done in #3743 / #3742). Duplicate stubs in `libSceAmpr` have been removed. - **Scope**: Covers `_Dtest`, `_Inf`, `sceLibcBacktrace*`, `_ZNSt4_Pad*`, `_Cnd_signal`, `_Thrd_id`, `_Thrd_join`, `_ZSt16_Throw_Cpp_errori`, `_Addstd`, and C++ ABI RTTI vtables. `sinhf` is intentionally excluded as it is tracked in #3725. - **Verification**: Full guest test coverage (`guest_math`, `guest_libc_threads`, `guest_libc_backtrace`) passes (100%), and `tools/check_conventions.py` passes with 0 errors. Whenever you have a chance, would appreciate your review!
github-actions[bot] commented 2026-10-12 00:28:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T00:28:35Z.


Progress report (0214069 → 8652dbe)

📈 System libraries: 88.16% (+0.01%, +4 implemented, +3 declared, -4 removed functions)

✅ 4 implemented
Library Name
libc IsFunctionTypeInfoTrue
libc IsPointerTypeInfoTrue
libc _Cnd_signal_nid_postfix
libc _Dtest_nid_postfix
⚪ 2 behaviourally empty (constant return or throw)
Library Name
libc IsFunctionTypeInfoTrue
libc IsPointerTypeInfoTrue
🆕 3 declared as stubs
Library Name
libc _ZNSt8ios_base7_AddstdEPS__nid_postfix
libc sceLibcBacktraceGetBufferSize_nid_postfix
libc sceLibcBacktraceSelf_nid_postfix
🗑️ 4 removed
Library Name
libSceAmpr _Cnd_signal_nid_postfix
libSceAmpr _ZNSt8ios_base7_AddstdEPS__nid_postfix
libSceAmpr _ZTVN10__cxxabiv119__pointer_type_infoE_nid_postfix
libSceAmpr _ZTVN10__cxxabiv120__function_type_infoE_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115604958 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6115604958). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T00:28:35Z. --- <!-- progress-report --> ### Progress report (0214069 → 8652dbe) 📈 **System libraries**: 88.16% (+0.01%, +4 implemented, +3 declared, -4 removed functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libc | `IsFunctionTypeInfoTrue` | | libc | `IsPointerTypeInfoTrue` | | libc | `_Cnd_signal_nid_postfix` | | libc | `_Dtest_nid_postfix` | </details> <details> <summary>⚪ 2 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libc | `IsFunctionTypeInfoTrue` | | libc | `IsPointerTypeInfoTrue` | </details> <details> <summary>🆕 3 declared as stubs</summary> | Library | Name | | - | - | | libc | `_ZNSt8ios_base7_AddstdEPS__nid_postfix` | | libc | `sceLibcBacktraceGetBufferSize_nid_postfix` | | libc | `sceLibcBacktraceSelf_nid_postfix` | </details> <details> <summary>🗑️ 4 removed</summary> | Library | Name | | - | - | | libSceAmpr | `_Cnd_signal_nid_postfix` | | libSceAmpr | `_ZNSt8ios_base7_AddstdEPS__nid_postfix` | | libSceAmpr | `_ZTVN10__cxxabiv119__pointer_type_infoE_nid_postfix` | | libSceAmpr | `_ZTVN10__cxxabiv120__function_type_infoE_nid_postfix` | </details>
oneandonlydean commented 2026-10-12 09:14:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T09:14:56Z.


_Pad::_Launch starts a host thread (core/libs/prx/libc/src/Threads.cpp:328,334) and runs the guest _Go on it, and _Thrd_join (Threads.cpp:356) waits on that host handle instead of joining the guest pthread_t as main's does. Guest code has to run on a guest thread: please create it through pthread_create_nid_postfix, as #3743 does for the same four _Pad exports, and keep main's _Thrd_join. libc is the right place for them.

Two more things before this can go in:

  • _Thrd_id returning the host thread id (Threads.cpp:344), _Thrd_join(nullptr) returning success (Threads.cpp:357), ios_base::_Addstd as a no-op (RuntimeSupport.cpp:187) and _Throw_Cpp_error throwing the host's std::system_error (Threads.cpp:352) are guesses. PPSA28997 only needs the exports to exist to load, so leave them throwing NotImplemented_nid_no_patch until a title calls them.
  • sceLibcBacktraceGetBufferSize and sceLibcBacktraceSelf: where does the record layout come from? guest_libc_backtrace only checks the return value. Either give the source and test the records, or keep these throwing too.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6121269432 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6121269432). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T09:14:56Z. --- `_Pad::_Launch` starts a host thread (`core/libs/prx/libc/src/Threads.cpp:328,334`) and runs the guest `_Go` on it, and `_Thrd_join` (`Threads.cpp:356`) waits on that host handle instead of joining the guest `pthread_t` as main's does. Guest code has to run on a guest thread: please create it through `pthread_create_nid_postfix`, as #3743 does for the same four `_Pad` exports, and keep main's `_Thrd_join`. libc is the right place for them. Two more things before this can go in: - `_Thrd_id` returning the host thread id (`Threads.cpp:344`), `_Thrd_join(nullptr)` returning success (`Threads.cpp:357`), `ios_base::_Addstd` as a no-op (`RuntimeSupport.cpp:187`) and `_Throw_Cpp_error` throwing the host's `std::system_error` (`Threads.cpp:352`) are guesses. PPSA28997 only needs the exports to exist to load, so leave them throwing `NotImplemented_nid_no_patch` until a title calls them. - `sceLibcBacktraceGetBufferSize` and `sceLibcBacktraceSelf`: where does the record layout come from? `guest_libc_backtrace` only checks the return value. Either give the source and test the records, or keep these throwing too.
hamb3r commented 2026-10-12 09:53:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-12T09:53:06Z.


Thanks for the review @oneandonlydean! I've addressed all points in commit aa27a61:

  1. Guest thread for _Pad::_Launch: Switched it to create a guest thread via pthread_create_nid_postfix with the PadEntry_nid_no_patch trampoline executing _Go().
  2. _Thrd_join: Kept main's implementation in libSceAmpr and removed the custom version from libc.
  3. Unverified stubs: _Thrd_id, _Throw_Cpp_error, and _Addstd now throw NotImplemented_nid_no_patch(__func__).
  4. Backtrace: Agreed, since I don't have console hardware verification for that binary record layout, I removed the custom layout and kept both sceLibcBacktraceGetBufferSize and sceLibcBacktraceSelf throwing NotImplemented_nid_no_patch(__func__).

I've also updated the unit tests (guest_libc_threads, guest_libc_backtrace, guest_ampr_threads) and TechnicalDebt.md accordingly. check_conventions.py passes with 0 errors.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6121872562 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6121872562). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-12T09:53:06Z. --- Thanks for the review @oneandonlydean! I've addressed all points in commit aa27a61: 1. **Guest thread for `_Pad::_Launch`**: Switched it to create a guest thread via `pthread_create_nid_postfix` with the `PadEntry_nid_no_patch` trampoline executing `_Go()`. 2. **`_Thrd_join`**: Kept `main`'s implementation in `libSceAmpr` and removed the custom version from `libc`. 3. **Unverified stubs**: `_Thrd_id`, `_Throw_Cpp_error`, and `_Addstd` now throw `NotImplemented_nid_no_patch(__func__)`. 4. **Backtrace**: Agreed, since I don't have console hardware verification for that binary record layout, I removed the custom layout and kept both `sceLibcBacktraceGetBufferSize` and `sceLibcBacktraceSelf` throwing `NotImplemented_nid_no_patch(__func__)`. I've also updated the unit tests (`guest_libc_threads`, `guest_libc_backtrace`, `guest_ampr_threads`) and `TechnicalDebt.md` accordingly. `check_conventions.py` passes with 0 errors.
p3n1cillin commented 2026-10-12 16:16:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-12T16:16:48Z.


I checked the PS5 SDK implementation of _Thrd_id while investigating Astro Bot (PPSA21564, 01.007.000). The locally unwrapped shipped libc.prx has SHA-256 31a0e9af83bc5b95b8f81949dd575b7708e90bd774f5ed3925843282bf98b54e.

Export np6xXcXEnXE#D#A, ELF vaddr 0x4f20 (11 bytes), calls the PLT at 0x115600 and returns with RAX unchanged. The PLT jumps through 0x192358; that JMPREL entry resolves symbol 499, aI+OeCz8xrQ#A#B, which hashes to scePthreadSelf. It does not call scePthreadGetthreadid (EI-5-jlq2dE). This supports preserving the guest pthread handle, including its upper bits, rather than using the Microsoft STL Windows 32-bit thread-ID representation. The original C++ declared type and console allocation/reuse policy remain unmeasured.

I tested a local Pthread wrapper returning scePthreadSelf() on main d592d54e1, with eight simultaneous guest pthreads, one adopted host thread and the caller. The regression checks stable, distinct live identities, equality with scePthreadSelf, and equality with each created pthread handle. The same regression fails against unchanged main at _Thrd_id_nid_postfix not implemented. On Windows 11, WinLibs GCC 15.2, Release, all four focused checks passed (guest_ampr_threads, guest_libc_threads, patched_libraries, progress_report) after building the complete library set. This is emulator validation, not a PS5 hardware run or an Astro Bot gameplay fix.

The current diff here relocates _Thrd_id into libc as a throwing stub. Its canonical placement needs coordination with that relocation. Would you prefer to incorporate the observed behavior here, or have a separate follow-up after the relocation lands? My tested local wrapper currently lives in AMPR; a libc implementation would need access to the same kernel thread identity without adding a library dependency cycle.

No game files or captured binaries are included. Investigation and tests were assisted by Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128161219 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6128161219). Originally posted by [p3n1cillin](https://github.com/p3n1cillin) on 2026-10-12T16:16:48Z. --- I checked the PS5 SDK implementation of `_Thrd_id` while investigating Astro Bot (PPSA21564, 01.007.000). The locally unwrapped shipped `libc.prx` has SHA-256 `31a0e9af83bc5b95b8f81949dd575b7708e90bd774f5ed3925843282bf98b54e`. Export `np6xXcXEnXE#D#A`, ELF vaddr `0x4f20` (11 bytes), calls the PLT at `0x115600` and returns with RAX unchanged. The PLT jumps through `0x192358`; that JMPREL entry resolves symbol 499, `aI+OeCz8xrQ#A#B`, which hashes to `scePthreadSelf`. It does not call `scePthreadGetthreadid` (`EI-5-jlq2dE`). This supports preserving the guest pthread handle, including its upper bits, rather than using the Microsoft STL Windows 32-bit thread-ID representation. The original C++ declared type and console allocation/reuse policy remain unmeasured. I tested a local `Pthread` wrapper returning `scePthreadSelf()` on main `d592d54e1`, with eight simultaneous guest pthreads, one adopted host thread and the caller. The regression checks stable, distinct live identities, equality with `scePthreadSelf`, and equality with each created pthread handle. The same regression fails against unchanged main at `_Thrd_id_nid_postfix not implemented`. On Windows 11, WinLibs GCC 15.2, Release, all four focused checks passed (`guest_ampr_threads`, `guest_libc_threads`, `patched_libraries`, `progress_report`) after building the complete library set. This is emulator validation, not a PS5 hardware run or an Astro Bot gameplay fix. The current diff here relocates `_Thrd_id` into libc as a throwing stub. Its canonical placement needs coordination with that relocation. Would you prefer to incorporate the observed behavior here, or have a separate follow-up after the relocation lands? My tested local wrapper currently lives in AMPR; a libc implementation would need access to the same kernel thread identity without adding a library dependency cycle. No game files or captured binaries are included. Investigation and tests were assisted by Codex.
MarcZX10 commented 2026-10-12 18:06:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T18:06:04Z.


One import-source check before removing _ZSt16_Throw_Cpp_errori_nid_postfix from libSceAmpr: issue #3346 reports Deathloop and Minecraft Legends importing this exact libSceAmpr export, and open PR #3679 implements it there. This PR adds a libc export, but imports are resolved from their named library, so that would not satisfy an import requesting libSceAmpr. Could you confirm whether those titles really import it from libSceAmpr, and preserve the AMPR export if they do? That would let the Unity libc case and the reported AMPR case coexist.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129844349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6129844349). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T18:06:04Z. --- One import-source check before removing `_ZSt16_Throw_Cpp_errori_nid_postfix` from `libSceAmpr`: issue #3346 reports Deathloop and Minecraft Legends importing this exact `libSceAmpr` export, and open PR #3679 implements it there. This PR adds a `libc` export, but imports are resolved from their named library, so that would not satisfy an import requesting `libSceAmpr`. Could you confirm whether those titles really import it from `libSceAmpr`, and preserve the AMPR export if they do? That would let the Unity `libc` case and the reported AMPR case coexist.
MarcZX10 commented 2026-10-12 18:13:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T18:13:37Z.


The scePthreadSelf trace and focused Windows regression described above are useful evidence for _Thrd_id returning the guest pthread identity. Since this PR currently leaves _Thrd_id throwing and the implementation may need dependency/placement work, a focused follow-up after the libc export location is settled seems easiest to review. Please coordinate with p3n1cillin on the tested wrapper and preserve the stated limitation: this is emulator validation, not a PS5 hardware result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129962007 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6129962007). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T18:13:37Z. --- The `scePthreadSelf` trace and focused Windows regression described above are useful evidence for `_Thrd_id` returning the guest pthread identity. Since this PR currently leaves `_Thrd_id` throwing and the implementation may need dependency/placement work, a focused follow-up after the libc export location is settled seems easiest to review. Please coordinate with p3n1cillin on the tested wrapper and preserve the stated limitation: this is emulator validation, not a PS5 hardware result.
hamb3r commented 2026-10-12 20:07:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-12T20:07:06Z.


@oneandonlydean Quick update: rebased cleanly on current main (resolving conflicts from the recent debt restructuring into docs/dev/debt/libc.md). All review feedback remains addressed, conventions and guest test suites pass.

@p3n1cillin Thanks a lot for investigating the PS5 libc.prx and verifying _Thrd_id! The scePthreadSelf finding is very valuable evidence. I agree with Marc that keeping _Thrd_id as a throwing stub in this PR and doing the full implementation (along with managing the libc <-> libkernel thread identity linkage) in a focused follow-up PR is the cleanest path forward for review and merge.

@MarcZX100 Thanks for bringing up the AMPR import case! Regarding keeping the exports in both libraries: tools/check_conventions.py strictly flags [duplicate-export] when the same APS5_VABI symbol is exported by multiple libraries. However, libSceAmpr importers like Deathloop and Minecraft Legends won't break: the relinker's host import resolution in WindowsEntryStubBuilder.cpp:112-114 automatically appends libc.prx to the search order for all host module imports. So an import requesting _ZSt16_Throw_Cpp_errori from libSceAmpr.prx falls back to libc.prx and resolves cleanly at runtime. Once this PR lands, your PR #3679 can rebase the full std::system_error implementation directly into libc.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131748394 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6131748394). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-12T20:07:06Z. --- @oneandonlydean Quick update: rebased cleanly on current `main` (resolving conflicts from the recent debt restructuring into `docs/dev/debt/libc.md`). All review feedback remains addressed, conventions and guest test suites pass. @p3n1cillin Thanks a lot for investigating the PS5 `libc.prx` and verifying `_Thrd_id`! The `scePthreadSelf` finding is very valuable evidence. I agree with Marc that keeping `_Thrd_id` as a throwing stub in this PR and doing the full implementation (along with managing the `libc` <-> `libkernel` thread identity linkage) in a focused follow-up PR is the cleanest path forward for review and merge. @MarcZX100 Thanks for bringing up the AMPR import case! Regarding keeping the exports in both libraries: `tools/check_conventions.py` strictly flags `[duplicate-export]` when the same `APS5_VABI` symbol is exported by multiple libraries. However, `libSceAmpr` importers like Deathloop and Minecraft Legends won't break: the relinker's host import resolution in `WindowsEntryStubBuilder.cpp:112-114` automatically appends `libc.prx` to the search order for all host module imports. So an import requesting `_ZSt16_Throw_Cpp_errori` from `libSceAmpr.prx` falls back to `libc.prx` and resolves cleanly at runtime. Once this PR lands, your PR #3679 can rebase the full `std::system_error` implementation directly into `libc`.
hamb3r commented 2026-10-12 21:11:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-12T21:11:09Z.


@oneandonlydean Rebased on latest main and resolved the conflict again.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132675435 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6132675435). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-12T21:11:09Z. --- @oneandonlydean Rebased on latest main and resolved the conflict again.
MarcZX10 commented 2026-10-13 07:12:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:12:04Z.


Thanks for clarifying the import-resolution behavior and the duplicate-export convention. Follow-up: #3679 has since merged, so _ZSt16_Throw_Cpp_errori is now provided from libc and the overlap should be resolved on current main. Your rebased PR can keep the throwing AMPR import resolution through the relinker's libc search fallback, as you describe.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140318479 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6140318479). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:12:04Z. --- Thanks for clarifying the import-resolution behavior and the duplicate-export convention. Follow-up: #3679 has since merged, so _ZSt16_Throw_Cpp_errori is now provided from libc and the overlap should be resolved on current main. Your rebased PR can keep the throwing AMPR import resolution through the relinker's libc search fallback, as you describe.
nicolasfalesy commented 2026-10-13 07:49:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-13T07:49:17Z.


Linux build (Arch, GCC 16.2.1, Release, BUILD_TESTING=ON), this PR's head d0d38e789 merged onto main 7e181fcc3: 137 test executables fail to link, for example guest_mktime_tests, guest_math_tests, guest_libc_backtrace_tests:

/usr/bin/ld: core/libs/libs/unpatched/libc.prx: undefined reference to `pthread_create_nid_postfix'
collect2: error: ld returned 1 exit status

On Windows _Pad::_Launch looks pthread_create_nid_postfix up at run time with GetProcAddress, but on other systems it declares it extern and calls it directly, so libc.prx gets an undefined reference to a libkernel symbol. Test programs that link only libc then fail. main builds these targets on the same machine. A run-time lookup on Linux too (for example dlsym(RTLD_DEFAULT, "pthread_create_nid_postfix")), like the Windows branch, would avoid the link-time dependency. The CI linux job is skipped for this PR, so it would not show there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140891247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6140891247). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-13T07:49:17Z. --- Linux build (Arch, GCC 16.2.1, Release, `BUILD_TESTING=ON`), this PR's head `d0d38e789` merged onto `main` 7e181fcc3: **137 test executables fail to link**, for example `guest_mktime_tests`, `guest_math_tests`, `guest_libc_backtrace_tests`: ``` /usr/bin/ld: core/libs/libs/unpatched/libc.prx: undefined reference to `pthread_create_nid_postfix' collect2: error: ld returned 1 exit status ``` On Windows `_Pad::_Launch` looks `pthread_create_nid_postfix` up at run time with `GetProcAddress`, but on other systems it declares it `extern` and calls it directly, so `libc.prx` gets an undefined reference to a libkernel symbol. Test programs that link only `libc` then fail. `main` builds these targets on the same machine. A run-time lookup on Linux too (for example `dlsym(RTLD_DEFAULT, "pthread_create_nid_postfix")`), like the Windows branch, would avoid the link-time dependency. The CI `linux` job is skipped for this PR, so it would not show there.
MarcZX10 commented 2026-10-13 08:31:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T08:31:19Z.


The linker failure reported above is a real portability blocker for this PR: the non-Windows branch leaves pthread_create_nid_postfix as a strong unresolved reference from libc.prx, so test executables that link libc without libkernel fail before any test can run. The Windows GetProcAddress path avoids that link-time dependency. Please make the non-Windows path resolve the symbol at runtime as well (or otherwise remove the libc → libkernel link-time dependency), while retaining an explicit failure if the symbol is unavailable. If using dlsym(RTLD_DEFAULT, ...), please verify that the loaded libkernel symbol is actually visible in that lookup scope; the key requirement is that standalone libc consumers still link.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141558988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6141558988). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T08:31:19Z. --- The linker failure reported above is a real portability blocker for this PR: the non-Windows branch leaves `pthread_create_nid_postfix` as a strong unresolved reference from `libc.prx`, so test executables that link libc without libkernel fail before any test can run. The Windows `GetProcAddress` path avoids that link-time dependency. Please make the non-Windows path resolve the symbol at runtime as well (or otherwise remove the libc → libkernel link-time dependency), while retaining an explicit failure if the symbol is unavailable. If using `dlsym(RTLD_DEFAULT, ...)`, please verify that the loaded libkernel symbol is actually visible in that lookup scope; the key requirement is that standalone libc consumers still link.
hamb3r commented 2026-10-13 10:21:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-13T10:21:37Z.


@nicolasfalesy @MarcZX100 Thanks for the diagnosis and discussion!

I have addressed both the link-time blocker and the post-patching symbol resolution in commit c95bdaba8:

  1. Link-time dependency eliminated: Removed the direct extern "C" reference to pthread_create_nid_postfix from libc.prx and linked `` in core/libs/prx/libc/CMakeLists.txt, so standalone libc consumers now link cleanly without libkernel.
  2. NID-first dynamic resolution: In CallPthreadCreate (core/libs/prx/libc/src/Threads.cpp), runtime lookup first queries OxhIB8LB-PQ (the deterministic NID generated by nid_patcher for pthread_create), and only falls back to pthread_create_nid_postfix for in-tree unpatched test harnesses.
  3. Verification:
    • guest_libc_threads unit tests pass against the unpatched test harness.
    • Verified that after nid_patcher runs on libkernel.prx, pthread_create_nid_postfix is stripped from exports and _Pad::_Launch resolves OxhIB8LB-PQ dynamically at runtime.
    • python tools/check_conventions.py --base origin/main passes with 0 errors.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143428222 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6143428222). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-13T10:21:37Z. --- @nicolasfalesy @MarcZX100 Thanks for the diagnosis and discussion! I have addressed both the link-time blocker and the post-patching symbol resolution in commit c95bdaba8: 1. **Link-time dependency eliminated**: Removed the direct `extern "C"` reference to `pthread_create_nid_postfix` from `libc.prx` and linked `` in `core/libs/prx/libc/CMakeLists.txt`, so standalone `libc` consumers now link cleanly without `libkernel`. 2. **NID-first dynamic resolution**: In `CallPthreadCreate` (`core/libs/prx/libc/src/Threads.cpp`), runtime lookup first queries `OxhIB8LB-PQ` (the deterministic NID generated by `nid_patcher` for `pthread_create`), and only falls back to `pthread_create_nid_postfix` for in-tree unpatched test harnesses. 3. **Verification**: - `guest_libc_threads` unit tests pass against the unpatched test harness. - Verified that after `nid_patcher` runs on `libkernel.prx`, `pthread_create_nid_postfix` is stripped from exports and `_Pad::_Launch` resolves `OxhIB8LB-PQ` dynamically at runtime. - `python tools/check_conventions.py --base origin/main` passes with 0 errors.
oneandonlydean commented 2026-10-13 10:32:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T10:32:02Z.


CallPthreadCreate (core/libs/prx/libc/src/Threads.cpp) now tries the NID, then the name, then LoadLibraryA / dlopen; fallback chains like this aren't allowed here. libkernel already links libc, so have libkernel register its pthread_create with libc when it loads, and make _Launch throw when nothing was registered.
Also please drop guest_libc_backtrace: it only checks that the stubs throw.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143599342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6143599342). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T10:32:02Z. --- `CallPthreadCreate` (`core/libs/prx/libc/src/Threads.cpp`) now tries the NID, then the name, then `LoadLibraryA` / `dlopen`; fallback chains like this aren't allowed here. libkernel already links libc, so have libkernel register its `pthread_create` with libc when it loads, and make `_Launch` throw when nothing was registered. Also please drop `guest_libc_backtrace`: it only checks that the stubs throw.
hamb3r commented 2026-10-13 13:01:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-13T13:01:44Z.


@oneandonlydean Thanks for the architectural guidance!

I've updated the implementation accordingly (commit fb151594c):

  1. Direct registration mechanism: Replaced the dynamic lookup / fallback chain with callback registration. libkernel now registers its pthread_create with libc upon loading (RegisterPthreadCreate_nid_no_patch).
  2. Explicit failure in _Launch: _ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix checks that pthread_create has been registered and explicitly throws std::runtime_error if called without a registered callback. Added a unit test in GuestLibcThreads.cpp validating this throwing behavior when unregistered as well as successful launch when registered.
  3. Clean dependencies: Dropped the dynamic lookup headers, LoadLibrary/dlopen logic, and ${CMAKE_DL_LIBS} linkage in libc/CMakeLists.txt. Standalone libc consumers link cleanly without libkernel.
  4. Dropped guest_libc_backtrace: Removed GuestLibcBacktrace.cpp and its test target as requested.
  5. Verification:
    • check_conventions.py passes with 0 errors.
    • Verified that all unit tests (guest_math, guest_libc_threads) pass on Windows (MinGW GCC 15).
    • Verified full project build (all 3115 targets, all 137+ test executables) compiles and links cleanly with 0 errors on Arch Linux (GCC 16.2.1) and Ubuntu 22.04 LTS.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6146144364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6146144364). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-13T13:01:44Z. --- @oneandonlydean Thanks for the architectural guidance! I've updated the implementation accordingly (commit `fb151594c`): 1. **Direct registration mechanism**: Replaced the dynamic lookup / fallback chain with callback registration. `libkernel` now registers its `pthread_create` with `libc` upon loading (`RegisterPthreadCreate_nid_no_patch`). 2. **Explicit failure in `_Launch`**: `_ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix` checks that `pthread_create` has been registered and explicitly throws `std::runtime_error` if called without a registered callback. Added a unit test in `GuestLibcThreads.cpp` validating this throwing behavior when unregistered as well as successful launch when registered. 3. **Clean dependencies**: Dropped the dynamic lookup headers, `LoadLibrary`/`dlopen` logic, and `${CMAKE_DL_LIBS}` linkage in `libc/CMakeLists.txt`. Standalone `libc` consumers link cleanly without `libkernel`. 4. **Dropped `guest_libc_backtrace`**: Removed `GuestLibcBacktrace.cpp` and its test target as requested. 5. **Verification**: - `check_conventions.py` passes with 0 errors. - Verified that all unit tests (`guest_math`, `guest_libc_threads`) pass on Windows (MinGW GCC 15). - Verified full project build (all 3115 targets, all 137+ test executables) compiles and links cleanly with 0 errors on Arch Linux (GCC 16.2.1) and Ubuntu 22.04 LTS.
hamb3r commented 2026-10-13 13:43:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-13T13:43:02Z.


@adriadam10 @oneandonlydean Rebased onto current main. As requested following the merge of #3743, dropped the std::_Pad and _Thrd_id exports from libc to avoid duplicate exports. The remaining additions (_Dtest, _Inf, sceLibcBacktrace*, _Cnd_signal, _ZNSt8ios_base7_AddstdEPS_, and typeinfo vtables) build and pass all unit tests and conventions on both Windows and Linux.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6146933054 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6146933054). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-13T13:43:02Z. --- @adriadam10 @oneandonlydean Rebased onto current `main`. As requested following the merge of #3743, dropped the `std::_Pad` and `_Thrd_id` exports from `libc` to avoid duplicate exports. The remaining additions (`_Dtest`, `_Inf`, `sceLibcBacktrace*`, `_Cnd_signal`, `_ZNSt8ios_base7_AddstdEPS_`, and typeinfo vtables) build and pass all unit tests and conventions on both Windows and Linux.
hamb3r commented 2026-10-13 16:06:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-13T16:06:10Z.


@adriadam10 @oneandonlydean Rebased onto current main again

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149808110 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6149808110). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-13T16:06:10Z. --- @adriadam10 @oneandonlydean Rebased onto current main again
github-actions[bot] commented 2026-10-13 20:26:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T20:26:19Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5454 docs/dev/debt/libc.md L67-68
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6154521256 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6154521256). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T20:26:19Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5454 | `docs/dev/debt/libc.md` [L67-68](https://github.com/boykopovar/AnyPS5/blob/665ad7da74606eba94ac4576f5e6d2ad6990c566/docs/dev/debt/libc.md#L67-L68) | | |
MarcZX10 commented 2026-10-13 20:28:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T20:28:49Z.


The latest overlap check only reports a shared hunk in docs/dev/debt/libc.md with #5454; it reports no shared exports or source files. These changes appear independent, so I don't see a dependency to add. If #5454 merges first, this PR will likely need the debt-doc hunk refreshed on rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6154563979 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6154563979). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T20:28:49Z. --- The latest overlap check only reports a shared hunk in `docs/dev/debt/libc.md` with #5454; it reports no shared exports or source files. These changes appear independent, so I don't see a dependency to add. If #5454 merges first, this PR will likely need the debt-doc hunk refreshed on rebase.
oneandonlydean commented 2026-10-13 21:05:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T21:05:05Z.


Please update the description to what this branch does now: the _Pad, _Thrd_id, _Thrd_join and _Throw_Cpp_error parts, the backtrace layout and guest_libc_backtrace are gone, and the debt entry is in docs/dev/debt/libc.md. Also list which of the PPSA28997 imports it resolves: dGYo9mE8K2A, gjLRZgfb3i0, xZqiZvmcp9k, a-z7wxuYO2E, np6xXcXEnXE and W0j6vCxh9Pc are exported only from libSceAmpr on main, so imports of them from libc.prx still fail.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155178000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6155178000). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T21:05:05Z. --- Please update the description to what this branch does now: the `_Pad`, `_Thrd_id`, `_Thrd_join` and `_Throw_Cpp_error` parts, the backtrace layout and `guest_libc_backtrace` are gone, and the debt entry is in `docs/dev/debt/libc.md`. Also list which of the PPSA28997 imports it resolves: `dGYo9mE8K2A`, `gjLRZgfb3i0`, `xZqiZvmcp9k`, `a-z7wxuYO2E`, `np6xXcXEnXE` and `W0j6vCxh9Pc` are exported only from libSceAmpr on main, so imports of them from `libc.prx` still fail.
hamb3r commented 2026-10-13 21:17:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-13T21:17:08Z.


Thanks @oneandonlydean! I have updated the PR description to accurately reflect what the branch does now:

  • Outlined the removed parts (_Pad, _Thrd_id, _Thrd_join, _Throw_Cpp_error, custom backtrace layout, and guest_libc_backtrace).
  • Referenced the technical debt entry in docs/dev/debt/libc.md.
  • Explicitly listed the 8 PPSA28997 imports resolved by this PR from libc.prx, as well as the 6 symbols that remain exported only from libSceAmpr on main.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155374329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4164#issuecomment-6155374329). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-13T21:17:08Z. --- Thanks @oneandonlydean! I have updated the PR description to accurately reflect what the branch does now: - Outlined the removed parts (`_Pad`, `_Thrd_id`, `_Thrd_join`, `_Throw_Cpp_error`, custom backtrace layout, and `guest_libc_backtrace`). - Referenced the technical debt entry in `docs/dev/debt/libc.md`. - Explicitly listed the 8 PPSA28997 imports resolved by this PR from `libc.prx`, as well as the 6 symbols that remain exported only from `libSceAmpr` on `main`.
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!4164
No description provided.