feat(libc): export Dinkumware thread primitives from libc.prx #8148

Merged
hamb3r merged 4 commits from upstream-pr/8148 into main 2026-10-20 17:21:50 +00:00
hamb3r commented 2026-10-20 00:22:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-20T00:22:55Z.


What

  • Follow up on #4164 by moving the remaining 7 Dinkumware thread and C++ error exports from libSceAmpr (core/libs/prx/libSceAmpr/Export.cpp) to libc (core/libs/prx/libc/src/Threads.cpp) where guest titles (such as Unity IL2CPP modules in PPSA28997) import them from libc.prx:
    • _ZNSt4_PadC2Ev (dGYo9mE8K2A)
    • _ZNSt4_PadD2Ev (gjLRZgfb3i0)
    • _ZNSt4_Pad8_ReleaseEv (a-z7wxuYO2E)
    • _ZNSt4_Pad7_LaunchEPP7pthread (xZqiZvmcp9k)
    • _Thrd_join (YvmY5Jf0VYU)
    • _Thrd_id (np6xXcXEnXE)
    • _ZSt16_Throw_Cpp_errori (W0j6vCxh9Pc)
  • Avoid a circular link dependency between libc and libkernel: libkernel registers pthread_create_nid_postfix and pthread_join_nid_postfix with libc on load via RegisterPthreadCreate_nid_no_patch and RegisterPthreadJoin_nid_no_patch (core/libs/prx/libc/include/General.hpp, core/libs/prx/libkernel/Pthread/Posix/Thread.cpp), and _Pad::_Launch and _Thrd_join throw std::runtime_error if called when unregistered.
  • Add PadLaunchAndJoin in core/libs/tests/GuestLibcThreads.cpp (linked only against libc) covering both the unregistered callback std::runtime_error paths and registered std::_Pad launch, release, destruction, and _Thrd_join.
  • Move the corresponding technical debt entries from docs/dev/debt/libSceAmpr.md to docs/dev/debt/libc.md.

Tested

  • Windows 10 (MSYS2 MinGW-w64 GCC 15.2.0, Ninja):
    • cmake --build build-portable --target libc libkernel libSceAmpr guest_libc_threads_tests guest_ampr_threads_tests guest_ampr_cpp_error_tests -j 16
    • ctest --test-dir build-portable -R "^(guest_libc_threads|guest_ampr_threads|guest_ampr_cpp_error)$" --output-on-failure -V -> 3/3 passed (guest_libc_threads fails to link on main without this change).
  • Windows 10, PPSA28997 (God of War: Sons of Sparta, eboot.elf + Il2cppUserAssemblies.prx): verified that all 7 libc.prx imports (dGYo9mE8K2A, gjLRZgfb3i0, a-z7wxuYO2E, xZqiZvmcp9k, YvmY5Jf0VYU, np6xXcXEnXE, W0j6vCxh9Pc) resolve cleanly at startup and the title transfers control to the ELF entry point (and together with #8137 reaches the main menu at 60 FPS).

Before (main):

[time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine)
[+0.000000 s] [src/HostCpu.cpp:193 operator()] host CPU AMD Ryzen 7 7700 8-Core Processor: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEOPT, XSAVEC, SSE4A, PREFETCHW, CLZERO, OS AVX state (XCR0); lacks none
FAIL: unresolved ELF import dGYo9mE8K2A from libc.prx
FAIL: unresolved ELF import xZqiZvmcp9k from libc.prx
FAIL: unresolved ELF import gjLRZgfb3i0 from libc.prx
FAIL: unresolved ELF import np6xXcXEnXE from libc.prx
FAIL: unresolved ELF import W0j6vCxh9Pc from libc.prx
FAIL: unresolved ELF import YvmY5Jf0VYU from libc.prx
FAIL: unresolved ELF import a-z7wxuYO2E from libc.prx
...
GetLastError: 127 - The specified procedure could not be found.

After (this PR):

[time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine)
[+0.000000 s] [src/HostCpu.cpp:193 operator()] host CPU AMD Ryzen 7 7700 8-Core Processor: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEOPT, XSAVEC, SSE4A, PREFETCHW, CLZERO, OS AVX state (XCR0); lacks none
Transferring control to ELF entry point
Argument Count = 1Arg 0 = app.exe
********** LAUNCHER CONTROL ************************************
	File System Root = NONE SPECIFIED
	Launcher Path = NONE SPECIFIED
	Launcher Arguments NONE SPECIFIED
**********/LAUNCHER CONTROL ************************************
sceKernelGetOperationMode mode=2 submode=0
[+0.032752 s] [src/Open.cpp:244 sceKernelOpen] path=/dev/urandom flags=0x0 nativeFlags=0x8000 mode=0214
[+0.033738 s] [src/Thread.cpp:648 RunThread] RunThread entry=0x140c37a50 arg=0000000210715bb0 self=00000000007a5a60
[+0.034043 s] [src/Thread.cpp:648 RunThread] RunThread entry=0x140c37a50 arg=0000000210715d00 self=00000000007a3ca0
[+0.043682 s] [src/Open.cpp:244 sceKernelOpen] path=/app0/Media/Metadata/global-metadata.dat flags=0x0 nativeFlags=0x8000 mode=0666
...
[+18.532645 s] [src/Write.cpp:163 WriteFileDescriptor] [ScreenShot] Enabled on main menu. Do not save screenshots

God of War: Sons of Sparta (PPSA28997)

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: PPSA28997 #1742 (together with #8137)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4929204837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8148). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-20T00:22:55Z. --- ### What - Follow up on #4164 by moving the remaining 7 Dinkumware thread and C++ error exports from `libSceAmpr` (`core/libs/prx/libSceAmpr/Export.cpp`) to `libc` (`core/libs/prx/libc/src/Threads.cpp`) where guest titles (such as Unity IL2CPP modules in PPSA28997) import them from `libc.prx`: - `_ZNSt4_PadC2Ev` (`dGYo9mE8K2A`) - `_ZNSt4_PadD2Ev` (`gjLRZgfb3i0`) - `_ZNSt4_Pad8_ReleaseEv` (`a-z7wxuYO2E`) - `_ZNSt4_Pad7_LaunchEPP7pthread` (`xZqiZvmcp9k`) - `_Thrd_join` (`YvmY5Jf0VYU`) - `_Thrd_id` (`np6xXcXEnXE`) - `_ZSt16_Throw_Cpp_errori` (`W0j6vCxh9Pc`) - Avoid a circular link dependency between `libc` and `libkernel`: `libkernel` registers `pthread_create_nid_postfix` and `pthread_join_nid_postfix` with `libc` on load via `RegisterPthreadCreate_nid_no_patch` and `RegisterPthreadJoin_nid_no_patch` (`core/libs/prx/libc/include/General.hpp`, `core/libs/prx/libkernel/Pthread/Posix/Thread.cpp`), and `_Pad::_Launch` and `_Thrd_join` throw `std::runtime_error` if called when unregistered. - Add `PadLaunchAndJoin` in `core/libs/tests/GuestLibcThreads.cpp` (linked only against `libc`) covering both the unregistered callback `std::runtime_error` paths and registered `std::_Pad` launch, release, destruction, and `_Thrd_join`. - Move the corresponding technical debt entries from `docs/dev/debt/libSceAmpr.md` to `docs/dev/debt/libc.md`. ### Tested - Windows 10 (MSYS2 MinGW-w64 GCC 15.2.0, Ninja): - `cmake --build build-portable --target libc libkernel libSceAmpr guest_libc_threads_tests guest_ampr_threads_tests guest_ampr_cpp_error_tests -j 16` - `ctest --test-dir build-portable -R "^(guest_libc_threads|guest_ampr_threads|guest_ampr_cpp_error)$" --output-on-failure -V` -> 3/3 passed (`guest_libc_threads` fails to link on `main` without this change). - Windows 10, PPSA28997 (*God of War: Sons of Sparta*, `eboot.elf` + `Il2cppUserAssemblies.prx`): verified that all 7 `libc.prx` imports (`dGYo9mE8K2A`, `gjLRZgfb3i0`, `a-z7wxuYO2E`, `xZqiZvmcp9k`, `YvmY5Jf0VYU`, `np6xXcXEnXE`, `W0j6vCxh9Pc`) resolve cleanly at startup and the title transfers control to the ELF entry point (and together with #8137 reaches the main menu at 60 FPS). Before (`main`): ```text [time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine) [+0.000000 s] [src/HostCpu.cpp:193 operator()] host CPU AMD Ryzen 7 7700 8-Core Processor: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEOPT, XSAVEC, SSE4A, PREFETCHW, CLZERO, OS AVX state (XCR0); lacks none FAIL: unresolved ELF import dGYo9mE8K2A from libc.prx FAIL: unresolved ELF import xZqiZvmcp9k from libc.prx FAIL: unresolved ELF import gjLRZgfb3i0 from libc.prx FAIL: unresolved ELF import np6xXcXEnXE from libc.prx FAIL: unresolved ELF import W0j6vCxh9Pc from libc.prx FAIL: unresolved ELF import YvmY5Jf0VYU from libc.prx FAIL: unresolved ELF import a-z7wxuYO2E from libc.prx ... GetLastError: 127 - The specified procedure could not be found. ``` After (this PR): ```text [time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine) [+0.000000 s] [src/HostCpu.cpp:193 operator()] host CPU AMD Ryzen 7 7700 8-Core Processor: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEOPT, XSAVEC, SSE4A, PREFETCHW, CLZERO, OS AVX state (XCR0); lacks none Transferring control to ELF entry point Argument Count = 1Arg 0 = app.exe ********** LAUNCHER CONTROL ************************************ File System Root = NONE SPECIFIED Launcher Path = NONE SPECIFIED Launcher Arguments NONE SPECIFIED **********/LAUNCHER CONTROL ************************************ sceKernelGetOperationMode mode=2 submode=0 [+0.032752 s] [src/Open.cpp:244 sceKernelOpen] path=/dev/urandom flags=0x0 nativeFlags=0x8000 mode=0214 [+0.033738 s] [src/Thread.cpp:648 RunThread] RunThread entry=0x140c37a50 arg=0000000210715bb0 self=00000000007a5a60 [+0.034043 s] [src/Thread.cpp:648 RunThread] RunThread entry=0x140c37a50 arg=0000000210715d00 self=00000000007a3ca0 [+0.043682 s] [src/Open.cpp:244 sceKernelOpen] path=/app0/Media/Metadata/global-metadata.dat flags=0x0 nativeFlags=0x8000 mode=0666 ... [+18.532645 s] [src/Write.cpp:163 WriteFileDescriptor] [ScreenShot] Enabled on main menu. Do not save screenshots ``` ![God of War: Sons of Sparta (PPSA28997)](https://raw.githubusercontent.com/hamb3r/AnyPS5/2ea6134d6f020c3965f2e10580e18ee5cc372e98/ppsa28997_main_menu.jpg) ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Unblocks: PPSA28997 #1742 (together with #8137) - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-20 00:23:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T00:23:30Z.


Progress report (34b1b77 → 387be86)

➖ System libraries: 80.13% (+0.0%, +6 implemented, +1 declared, -7 removed functions)

✅ 6 implemented
Library Name
libc _Thrd_join_nid_postfix
libc _ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix
libc _ZNSt4_Pad8_ReleaseEv_nid_postfix
libc _ZNSt4_PadC2Ev_nid_postfix
libc _ZNSt4_PadD2Ev_nid_postfix
libc _ZSt16_Throw_Cpp_errori_nid_postfix
🆕 1 declared as stubs
Library Name
libc _Thrd_id_nid_postfix
🗑️ 7 removed
Library Name
libSceAmpr _Thrd_id_nid_postfix
libSceAmpr _Thrd_join_nid_postfix
libSceAmpr _ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix
libSceAmpr _ZNSt4_Pad8_ReleaseEv_nid_postfix
libSceAmpr _ZNSt4_PadC2Ev_nid_postfix
libSceAmpr _ZNSt4_PadD2Ev_nid_postfix
libSceAmpr _ZSt16_Throw_Cpp_errori_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280347437 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8148#issuecomment-6280347437). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T00:23:30Z. --- <!-- progress-report --> ### Progress report (34b1b77 → 387be86) ➖ **System libraries**: 80.13% (+0.0%, +6 implemented, +1 declared, -7 removed functions) <details> <summary>✅ 6 implemented</summary> | Library | Name | | - | - | | libc | `_Thrd_join_nid_postfix` | | libc | `_ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix` | | libc | `_ZNSt4_Pad8_ReleaseEv_nid_postfix` | | libc | `_ZNSt4_PadC2Ev_nid_postfix` | | libc | `_ZNSt4_PadD2Ev_nid_postfix` | | libc | `_ZSt16_Throw_Cpp_errori_nid_postfix` | </details> <details> <summary>🆕 1 declared as stubs</summary> | Library | Name | | - | - | | libc | `_Thrd_id_nid_postfix` | </details> <details> <summary>🗑️ 7 removed</summary> | Library | Name | | - | - | | libSceAmpr | `_Thrd_id_nid_postfix` | | libSceAmpr | `_Thrd_join_nid_postfix` | | libSceAmpr | `_ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix` | | libSceAmpr | `_ZNSt4_Pad8_ReleaseEv_nid_postfix` | | libSceAmpr | `_ZNSt4_PadC2Ev_nid_postfix` | | libSceAmpr | `_ZNSt4_PadD2Ev_nid_postfix` | | libSceAmpr | `_ZSt16_Throw_Cpp_errori_nid_postfix` | </details>
github-actions[bot] commented 2026-10-20 00:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T00:34:24Z.


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
PR 6565 docs/dev/debt/libc.md L127
PR 7411 docs/dev/debt/libc.md L122-123
PR 7417 docs/dev/debt/libc.md L122-123
PR 7648 core/libs/prx/libSceAmpr/Export.cpp L229-240, L277-303, L908-960
PR 8352 core/libs/tests/GuestLibcThreads.cpp L19, L185, L191
PR 8396 core/libs/prx/libSceAmpr/Export.cpp L272-275

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1835 core/libs/prx/libc/src/Threads.cpp
PR 5021 core/libs/prx/libc/src/Threads.cpp
docs/dev/debt/libc.md
PR 6044 core/libs/tests/GuestLibcThreads.cpp
PR 6226 docs/dev/debt/libc.md
PR 6469 docs/dev/debt/libc.md
PR 6819 docs/dev/debt/libc.md
PR 7081 core/libs/prx/libSceAmpr/Export.cpp
docs/dev/debt/libc.md
PR 7201 core/libs/prx/libc/src/Threads.cpp
PR 7473 docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280492313 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8148#issuecomment-6280492313). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T00:34:24Z. --- <!-- 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 | |---|---|---|---| | [PR 6565](https://www.github.com/boykopovar/AnyPS5/pull/6565) | `docs/dev/debt/libc.md` [L127](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/docs/dev/debt/libc.md#L127) | | | | [PR 7411](https://www.github.com/boykopovar/AnyPS5/pull/7411) | `docs/dev/debt/libc.md` [L122-123](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/docs/dev/debt/libc.md#L122-L123) | | | | [PR 7417](https://www.github.com/boykopovar/AnyPS5/pull/7417) | `docs/dev/debt/libc.md` [L122-123](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/docs/dev/debt/libc.md#L122-L123) | | | | [PR 7648](https://www.github.com/boykopovar/AnyPS5/pull/7648) | `core/libs/prx/libSceAmpr/Export.cpp` [L229-240](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/prx/libSceAmpr/Export.cpp#L229-L240), [L277-303](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/prx/libSceAmpr/Export.cpp#L277-L303), [L908-960](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/prx/libSceAmpr/Export.cpp#L908-L960) | | | | [PR 8352](https://www.github.com/boykopovar/AnyPS5/pull/8352) | `core/libs/tests/GuestLibcThreads.cpp` [L19](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/tests/GuestLibcThreads.cpp#L19), [L185](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/tests/GuestLibcThreads.cpp#L185), [L191](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/tests/GuestLibcThreads.cpp#L191) | | | | [PR 8396](https://www.github.com/boykopovar/AnyPS5/pull/8396) | `core/libs/prx/libSceAmpr/Export.cpp` [L272-275](https://github.com/boykopovar/AnyPS5/blob/f6ce8e34a20a9d6728a728c4769335ecaf5edea0/core/libs/prx/libSceAmpr/Export.cpp#L272-L275) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | `core/libs/prx/libc/src/Threads.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libc/src/Threads.cpp`<br>`docs/dev/debt/libc.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestLibcThreads.cpp` | | [PR 6226](https://www.github.com/boykopovar/AnyPS5/pull/6226) | `docs/dev/debt/libc.md` | | [PR 6469](https://www.github.com/boykopovar/AnyPS5/pull/6469) | `docs/dev/debt/libc.md` | | [PR 6819](https://www.github.com/boykopovar/AnyPS5/pull/6819) | `docs/dev/debt/libc.md` | | [PR 7081](https://www.github.com/boykopovar/AnyPS5/pull/7081) | `core/libs/prx/libSceAmpr/Export.cpp`<br>`docs/dev/debt/libc.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libc/src/Threads.cpp` | | [PR 7473](https://www.github.com/boykopovar/AnyPS5/pull/7473) | `docs/dev/debt/libc.md` | | [PR 7715](https://www.github.com/boykopovar/AnyPS5/pull/7715) | `docs/dev/debt/libc.md` | | [PR 8150](https://www.github.com/boykopovar/AnyPS5/pull/8150) | `docs/dev/debt/libc.md` |
babyhuey commented 2026-10-20 06:53:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-20T06:53:32Z.


Linux run of this head (387be8600), since the description covers Windows only and this changes how libc and libkernel link. Merged onto main 15da28937 (clean merge). Ubuntu 24.04 container, GCC 13, Release, BUILD_TESTING=ON, full build.

  • The build succeeds, with no warnings in Threads.cpp, Pthread/Posix/Thread.cpp, GuestLibcThreads.cpp or the libSceAmpr export.
  • guest_libc_threads, guest_ampr_threads and guest_ampr_cpp_error each pass 5 of 5 (--repeat until-fail:5).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6285215905 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8148#issuecomment-6285215905). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-20T06:53:32Z. --- Linux run of this head (387be8600), since the description covers Windows only and this changes how `libc` and `libkernel` link. Merged onto `main` `15da28937` (clean merge). Ubuntu 24.04 container, GCC 13, Release, `BUILD_TESTING=ON`, full build. - The build succeeds, with no warnings in `Threads.cpp`, `Pthread/Posix/Thread.cpp`, `GuestLibcThreads.cpp` or the `libSceAmpr` export. - `guest_libc_threads`, `guest_ampr_threads` and `guest_ampr_cpp_error` each pass 5 of 5 (`--repeat until-fail:5`).
wachi35676 commented 2026-10-20 11:29:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T11:29:57Z.


Windows run of 387be8600 merged onto main 02fb1ce53 (clean merge). Windows 11 (10.0.26300), Ryzen 5 9600X, WinLibs GCC 15.2.0 UCRT, Release, BUILD_TESTING=ON.

  • ctest -R "^(guest_libc_threads|guest_ampr)": 4 of 4 pass, 3 runs out of 3. The build log has no warnings. With the four changed sources reverted, guest_libc_threads_tests does not link, and guest_ampr_threads/guest_ampr_cpp_error exit 0xc0000139.
  • objdump -p of the built .prx files: libc.prx now exports the seven _nid_postfix names, and libSceAmpr.prx exports none of them.
  • Titles that import these from libSceAmpr: d991cdccf added the _Pad exports to libSceAmpr because Deathloop (PPSA01670) and Minecraft Legends (PPSA05510) import them from there. On Windows such an import still resolves after the move, because WindowsEntryStubBuilder.cpp (L172-176 on main) appends libc.prx to the search order of every import from a host module. On Linux the import is found by symbol name, and the relinker adds no per-library symbol versions. I could not run either title, so this is from the code only.
  • The description's name-to-NID list does not match the NIDs the code produces (tools/nid_names.py compute_nid, and the same in aerolib): _Thrd_join is YvmY5Jf0VYU, _ZSt16_Throw_Cpp_errori is W0j6vCxh9Pc, _ZNSt4_Pad8_ReleaseEv is a-z7wxuYO2E, and _ZNSt4_Pad7_LaunchEPP7pthread is xZqiZvmcp9k. The "Before" log lists j43330743sY, which is not in aerolib and is not the NID of any of the seven names, and it leaves out YvmY5Jf0VYU. The log in #8137 for the same title lists YvmY5Jf0VYU. The code is correct; only the description needs the corrected pairs.

AI-assisted: yes (Claude Code); results above were run on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6289847757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8148#issuecomment-6289847757). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-20T11:29:57Z. --- Windows run of `387be8600` merged onto `main` `02fb1ce53` (clean merge). Windows 11 (10.0.26300), Ryzen 5 9600X, WinLibs GCC 15.2.0 UCRT, Release, `BUILD_TESTING=ON`. - `ctest -R "^(guest_libc_threads|guest_ampr)"`: 4 of 4 pass, 3 runs out of 3. The build log has no warnings. With the four changed sources reverted, `guest_libc_threads_tests` does not link, and `guest_ampr_threads`/`guest_ampr_cpp_error` exit `0xc0000139`. - `objdump -p` of the built `.prx` files: `libc.prx` now exports the seven `_nid_postfix` names, and `libSceAmpr.prx` exports none of them. - Titles that import these from `libSceAmpr`: `d991cdccf` added the `_Pad` exports to `libSceAmpr` because Deathloop (PPSA01670) and Minecraft Legends (PPSA05510) import them from there. On Windows such an import still resolves after the move, because `WindowsEntryStubBuilder.cpp` (L172-176 on `main`) appends `libc.prx` to the search order of every import from a host module. On Linux the import is found by symbol name, and the relinker adds no per-library symbol versions. I could not run either title, so this is from the code only. - The description's name-to-NID list does not match the NIDs the code produces (`tools/nid_names.py compute_nid`, and the same in aerolib): `_Thrd_join` is `YvmY5Jf0VYU`, `_ZSt16_Throw_Cpp_errori` is `W0j6vCxh9Pc`, `_ZNSt4_Pad8_ReleaseEv` is `a-z7wxuYO2E`, and `_ZNSt4_Pad7_LaunchEPP7pthread` is `xZqiZvmcp9k`. The "Before" log lists `j43330743sY`, which is not in aerolib and is not the NID of any of the seven names, and it leaves out `YvmY5Jf0VYU`. The log in #8137 for the same title lists `YvmY5Jf0VYU`. The code is correct; only the description needs the corrected pairs. AI-assisted: yes (Claude Code); results above were run on this machine.
hamb3r commented 2026-10-20 11:40:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-20T11:40:37Z.


Thanks @wachi35676 for the careful catch on the NID pairings in the PR description — updated the description so each symbol and Before (main) log line matches its exact NID in Data.h. Also thank you @babyhuey for testing on Linux!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290024142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8148#issuecomment-6290024142). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-20T11:40:37Z. --- Thanks @wachi35676 for the careful catch on the NID pairings in the PR description — updated the description so each symbol and `Before (main)` log line matches its exact NID in `Data.h`. Also thank you @babyhuey for testing on Linux!
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!8148
No description provided.