Linux: titles that bundle libc.prx fail to load, and the host libc binds its own exports to the title's libc #476

Closed
opened 2026-10-03 19:26:39 +00:00 by ThisIsAkill · 11 comments
ThisIsAkill commented 2026-10-03 19:26:39 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-03T19:26:39Z.


Summary

When a title ships its own sce_module/libc.prx, two things go wrong on Linux that do not happen on Windows:

  1. Load failure. GuestModuleBuilder drops host dependencies whose name matches a guest module (addHost), so the executable never lists the host libc.prx. Every host prx needs libc.prx, but their DT_RUNPATH is empty (the CMake build path is blanked after NID patching) and DT_RUNPATH is not inherited, so the loader searches only system paths:
    error while loading shared libraries: libc.prx: cannot open shared object file
    Windows already covers this: WindowsImportBuilder::ReadLibraries appends libc.prx when libSceLibcInternal.prx is imported without it (f146a3d0).

  2. Symbol interposition. With the host libc.prx made loadable (LD_LIBRARY_PATH), the title's libc and ours export the same NIDs. ELF resolves every reference through one global scope, and the guest libc comes first (guest modules are listed ahead of host prx, as intended for the title's own imports, see 9cfdbff1). So the host libc's own references to its exports bind to the guest libc too. LD_DEBUG=bindings shows 34 such references from the host libc.prx: _Stdin/_Stdout/_Stderr, typeinfo and vtables of the std exceptions, __gxx_personality_v0 (NID), _sceLibcClassicLocale. Six other host prx bind their weak inline std::ctype<char>::do_widen / do_narrow instantiations (exported under the PS5 NIDs) to the guest libc as well.
    On Windows this cannot happen: a DLL binds references to its own definitions internally, and only the title's imports go through the ordered GetProcAddress search.

Observed failure

PPSA21567 (Linux, GCC 16.2, main d3ec1f15, LD_LIBRARY_PATH workaround): SIGSEGV in the guest libc's memcpy, called from fputs / puts in the title's startup code. The title's _Stdout holds what FileStream _Stdout_nid_postfix{stdout} writes: flags 8 and descriptor 1 at offsets 16/18, null position and buffer, and glibc's _IO_2_1_stdout_ at offset 256. The host libc's static initializer built its stream on top of the guest FILE.

Experiment

Host libc.prx linked with -Wl,-Bsymbolic (only that target, via a deferred target_link_options; nothing else changed):

Bindings Baseline libc -Bsymbolic
host libc → guest libc 34 0
other host prx → guest libc (do_widen, do_narrow) 7 7
guest libc → host libc (__error, __stack_chk_*, two sceLibcInternal*ForGame; expected imports) 5 5

Result:

  • Baseline: SIGSEGV in guest puts before any output.
  • libc -Bsymbolic: boots; the title logs, mounts save data and submits GPU work, then stops at the first unsupported shader feature (unsupported descriptor role Gds).

Proposed direction

  1. Relinker (Linux): mirror the Windows rule: when the executable imports libSceLibcInternal.prx and no host libc.prx remains, append libc.prx as the last DT_NEEDED. Lowest priority keeps the guest-first order for the title's imports.
  2. Build: link the host prx with -Wl,-Bsymbolic so a library's references to its own exports resolve inside it, which matches PE semantics. Required for libc; applying it to all prx would also keep the weak std::ctype copies internal. Protected visibility would need annotating every export, and protected data symbols conflict with copy relocations, so -Bsymbolic fits the build better.
  3. Not proposed: DT_RUNPATH=$ORIGIN on the built prx would also fix the load failure, independent of the executable's run path. But it changes nothing about (2), the patcher would have to write it in place of the blanked build path, and it diverges from Windows, where the library list is explicit. It could be a separate hardening change.

Questions:

  • Is binding the title's own imports to the guest libc first (9cfdbff1) the intended order on Linux too?
  • Should the host prx export the weak libstdc++ inline instantiations under PS5 NIDs at all?

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5692815947 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-03T19:26:39Z. --- ### Summary When a title ships its own `sce_module/libc.prx`, two things go wrong on Linux that do not happen on Windows: 1. **Load failure.** `GuestModuleBuilder` drops host dependencies whose name matches a guest module (`addHost`), so the executable never lists the host `libc.prx`. Every host prx needs `libc.prx`, but their `DT_RUNPATH` is empty (the CMake build path is blanked after NID patching) and `DT_RUNPATH` is not inherited, so the loader searches only system paths: `error while loading shared libraries: libc.prx: cannot open shared object file` Windows already covers this: `WindowsImportBuilder::ReadLibraries` appends `libc.prx` when `libSceLibcInternal.prx` is imported without it (f146a3d0). 2. **Symbol interposition.** With the host `libc.prx` made loadable (`LD_LIBRARY_PATH`), the title's libc and ours export the same NIDs. ELF resolves every reference through one global scope, and the guest libc comes first (guest modules are listed ahead of host prx, as intended for the title's own imports, see 9cfdbff1). So the host libc's *own* references to its exports bind to the guest libc too. `LD_DEBUG=bindings` shows 34 such references from the host `libc.prx`: `_Stdin`/`_Stdout`/`_Stderr`, typeinfo and vtables of the std exceptions, `__gxx_personality_v0` (NID), `_sceLibcClassicLocale`. Six other host prx bind their weak inline `std::ctype<char>::do_widen` / `do_narrow` instantiations (exported under the PS5 NIDs) to the guest libc as well. On Windows this cannot happen: a DLL binds references to its own definitions internally, and only the title's imports go through the ordered `GetProcAddress` search. ### Observed failure PPSA21567 (Linux, GCC 16.2, `main` d3ec1f15, `LD_LIBRARY_PATH` workaround): SIGSEGV in the guest libc's `memcpy`, called from `fputs` / `puts` in the title's startup code. The title's `_Stdout` holds what `FileStream _Stdout_nid_postfix{stdout}` writes: flags 8 and descriptor 1 at offsets 16/18, null position and buffer, and glibc's `_IO_2_1_stdout_` at offset 256. The host libc's static initializer built its stream on top of the guest `FILE`. ### Experiment Host `libc.prx` linked with `-Wl,-Bsymbolic` (only that target, via a deferred `target_link_options`; nothing else changed): | Bindings | Baseline | libc `-Bsymbolic` | |---|---:|---:| | host libc → guest libc | 34 | 0 | | other host prx → guest libc (`do_widen`, `do_narrow`) | 7 | 7 | | guest libc → host libc (`__error`, `__stack_chk_*`, two `sceLibcInternal*ForGame`; expected imports) | 5 | 5 | Result: - Baseline: SIGSEGV in guest `puts` before any output. - libc `-Bsymbolic`: boots; the title logs, mounts save data and submits GPU work, then stops at the first unsupported shader feature (`unsupported descriptor role Gds`). ### Proposed direction 1. **Relinker (Linux):** mirror the Windows rule: when the executable imports `libSceLibcInternal.prx` and no host `libc.prx` remains, append `libc.prx` as the last `DT_NEEDED`. Lowest priority keeps the guest-first order for the title's imports. 2. **Build:** link the host prx with `-Wl,-Bsymbolic` so a library's references to its own exports resolve inside it, which matches PE semantics. Required for libc; applying it to all prx would also keep the weak `std::ctype` copies internal. Protected visibility would need annotating every export, and protected data symbols conflict with copy relocations, so `-Bsymbolic` fits the build better. 3. **Not proposed:** `DT_RUNPATH=$ORIGIN` on the built prx would also fix the load failure, independent of the executable's run path. But it changes nothing about (2), the patcher would have to write it in place of the blanked build path, and it diverges from Windows, where the library list is explicit. It could be a separate hardening change. Questions: - Is binding the title's own imports to the guest libc first (9cfdbff1) the intended order on Linux too? - Should the host prx export the weak libstdc++ inline instantiations under PS5 NIDs at all? AI-assisted: yes.
ThisIsAkill commented 2026-10-03 20:00:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-03T20:00:17Z.


Correction to the proposed direction: -Wl,-Bsymbolic on libc, as proposed above, breaks two existing tests on main d3ec1f15 (Linux, GCC 16.2). Both pass again with the normal libc (same test binaries, library swapped with LD_LIBRARY_PATH).

  • guest_standard_streams: the host test executable has R_X86_64_COPY relocations for _Stdout, _Stderr, __stdoutp, __stderrp, __stdinp, __isthreaded. With -Bsymbolic, libc keeps using its own definitions while the test reads the copies.
  • guest_memory: aborts with fixed mapping … overlaps a registered guest allocation …, thrown from libkernel's flexible-memory mapping path and expected to be caught by the test. The test executable links libstdc++ statically and exports its own __gxx_personality_v0. With -Bsymbolic, libc's frames use libc's personality routine and the other frames use the executable's, and the handler is no longer found. I have not traced why mixing the two loses the handler.

Bisected by relinking libc with --dynamic-list (everything else bound locally, as with -Bsymbolic):

Kept preemptible guest_memory guest_standard_streams
nothing (-Bsymbolic) fails fails
__gxx_personality_v0 passes fails
__gxx_personality_v0 + those 6 symbols + _Stdin passes passes

The last row only passes because _Stdout is preemptible again, and that is the binding that crashes the bundled-libc title. -Bsymbolic-functions alone would not fix that crash either, since the crash comes from data (_Stdout), not functions.

The relinked title has no copy relocations (app.elf and both guest modules: 0 R_X86_64_COPY), so the conflict shows up only in host-built executables such as the tests.

Options for you to weigh (I am not picking one):

  1. Internal hidden aliases for libc's own references to its exported data and typeinfo/vtables, so libc never goes through the GOT for its own objects, and leave dynamic binding unchanged otherwise.
  2. Build the host test executables so they do not use copy relocations (-fPIC, or -mno-direct-extern-access on GCC 12+), keeping -Bsymbolic (or a --dynamic-list) on libc.
  3. Limit -Bsymbolic to libc and fix the two tests to match: no copy relocations of libc data, and one personality routine.

The relinker part of the proposal (append host libc.prx as the last DT_NEEDED) is unaffected.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5972953096 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5972953096). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-03T20:00:17Z. --- Correction to the proposed direction: `-Wl,-Bsymbolic` on libc, as proposed above, breaks two existing tests on `main` d3ec1f15 (Linux, GCC 16.2). Both pass again with the normal libc (same test binaries, library swapped with `LD_LIBRARY_PATH`). - **`guest_standard_streams`**: the host test executable has `R_X86_64_COPY` relocations for `_Stdout`, `_Stderr`, `__stdoutp`, `__stderrp`, `__stdinp`, `__isthreaded`. With `-Bsymbolic`, libc keeps using its own definitions while the test reads the copies. - **`guest_memory`**: aborts with `fixed mapping … overlaps a registered guest allocation …`, thrown from libkernel's flexible-memory mapping path and expected to be caught by the test. The test executable links libstdc++ statically and exports its own `__gxx_personality_v0`. With `-Bsymbolic`, libc's frames use libc's personality routine and the other frames use the executable's, and the handler is no longer found. I have not traced why mixing the two loses the handler. Bisected by relinking libc with `--dynamic-list` (everything else bound locally, as with `-Bsymbolic`): | Kept preemptible | `guest_memory` | `guest_standard_streams` | |---|---|---| | nothing (`-Bsymbolic`) | fails | fails | | `__gxx_personality_v0` | passes | fails | | `__gxx_personality_v0` + those 6 symbols + `_Stdin` | passes | passes | The last row only passes because `_Stdout` is preemptible again, and that is the binding that crashes the bundled-libc title. `-Bsymbolic-functions` alone would not fix that crash either, since the crash comes from data (`_Stdout`), not functions. The relinked title has no copy relocations (`app.elf` and both guest modules: 0 `R_X86_64_COPY`), so the conflict shows up only in host-built executables such as the tests. Options for you to weigh (I am not picking one): 1. Internal hidden aliases for libc's own references to its exported data and typeinfo/vtables, so libc never goes through the GOT for its own objects, and leave dynamic binding unchanged otherwise. 2. Build the host test executables so they do not use copy relocations (`-fPIC`, or `-mno-direct-extern-access` on GCC 12+), keeping `-Bsymbolic` (or a `--dynamic-list`) on libc. 3. Limit `-Bsymbolic` to libc and fix the two tests to match: no copy relocations of libc data, and one personality routine. The relinker part of the proposal (append host `libc.prx` as the last `DT_NEEDED`) is unaffected.
ThisIsAkill commented 2026-10-03 22:48:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-03T22:48:29Z.


Follow-up on the guest_memory failure with -Bsymbolic (my earlier comment left the mechanism open). #478 makes it clear: libc's unwinder dispatches on the frame's personality pointer (CallPersonality in exception/Unwind.cpp) by comparing it with libc's own reference to __gxx_personality_v0.

  • Without -Bsymbolic, that reference and the frames' CIE personality pointers all resolve, through global lookup, to the test executable's statically linked __gxx_personality_v0, so they match.
  • With -Bsymbolic, libc's reference binds to libc's own definition, while frames of the executable and libkernel still point at the executable's copy. The comparison fails, the frame is treated as a foreign personality, phase 1 fails, and the exception reaches terminate.

#478 handles __gcc_personality_v0 only, so it does not change this. A libc that binds its own references locally would also have to recognise the C++ personality the host test executables link statically.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5974307673 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5974307673). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-03T22:48:29Z. --- Follow-up on the `guest_memory` failure with `-Bsymbolic` (my earlier comment left the mechanism open). #478 makes it clear: libc's unwinder dispatches on the frame's personality pointer (`CallPersonality` in `exception/Unwind.cpp`) by comparing it with libc's own reference to `__gxx_personality_v0`. - Without `-Bsymbolic`, that reference and the frames' CIE personality pointers all resolve, through global lookup, to the test executable's statically linked `__gxx_personality_v0`, so they match. - With `-Bsymbolic`, libc's reference binds to libc's own definition, while frames of the executable and libkernel still point at the executable's copy. The comparison fails, the frame is treated as a foreign personality, phase 1 fails, and the exception reaches `terminate`. #478 handles `__gcc_personality_v0` only, so it does not change this. A libc that binds its own references locally would also have to recognise the C++ personality the host test executables link statically.
Amielle-Inside commented 2026-10-04 08:52:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amielle-Inside on 2026-10-04T08:52:11Z.


PPSA16951 (Tales of Xillia Remastered, Unity IL2CPP) is a second data point for the bundled-libc pattern, with some additional findings.

Dump: clean PS5 App Dumper v1.09 output; eboot.bin and all of sce_module/ plus the Unity modules (Il2cppUserAssemblies.prx 89 MB, cri_ware_unity.prx, lib_burst_generated.prx, PSN.prx, SaveData.prx, toxr_dlc_plugin.prx) are SELF/FSELF containers (magic 4F 15 3D 1D, second variant 54 14 F5 EE seen on one module). Extracted ELFs by parsing the SELF header per PR #28's algorithm (ELF base at 32 + n*32, all segments uncompressed).

With main (post-#358, so the libcCyberUnknown stubs exist), LD_LIBRARY_PATH workaround and the relinked executable loading, the failure is the same host-libc-binds-to-guest-libc family described here, and additionally:

  • The guest libc exports ~2926 NIDs and the title's startup reaches PS5 libc++ iostream init (_ZNSt8__sce_v24coutE -> __cxa_demangle -> operator new) before a bad_alloc (uncaught, _ZSt14_Throw_C_errori path), i.e. the guest allocator returns null during stream init — no video/system module init happens before this point.
  • LD_PRELOAD interposition confirmed the mechanism anecdotally: stubbing _Cnd_init/_Mtx_init/__cxa_atexit ahead of the host libc changed nothing about the crash, and the missing-export set the title actually hits at runtime is small (a dozen C11/C++ABI imports plus two libSceAudiodec/libSceMsgDialog NIDs).
  • Those C11 imports are now implemented in #492 (identified by forward-hashing candidate names with the project's own Nid::Compute; the wrapped libcCyberUnknown10/12 etc. turn out to be _Cnd_init/_Mtx_init).

Something the experiment here may also want to account for: this title runs Unity IL2CPP, so the module count and Il2cppUserAssemblies.prx size stress the guest-module loader far more than PPSA21567 apparently does. Happy to provide the extracted import tables or the relinker diagnostics if useful.

(This investigation was AI-assisted — GLM 5.3 via Hermes Agent — and the writeup was reviewed by me.)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978271902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5978271902). Originally posted by [Amielle-Inside](https://github.com/Amielle-Inside) on 2026-10-04T08:52:11Z. --- PPSA16951 (Tales of Xillia Remastered, Unity IL2CPP) is a second data point for the bundled-libc pattern, with some additional findings. Dump: clean PS5 App Dumper v1.09 output; `eboot.bin` and all of `sce_module/` plus the Unity modules (`Il2cppUserAssemblies.prx` 89 MB, `cri_ware_unity.prx`, `lib_burst_generated.prx`, `PSN.prx`, `SaveData.prx`, `toxr_dlc_plugin.prx`) are SELF/FSELF containers (magic `4F 15 3D 1D`, second variant `54 14 F5 EE` seen on one module). Extracted ELFs by parsing the SELF header per PR #28's algorithm (ELF base at `32 + n*32`, all segments uncompressed). With `main` (post-#358, so the `libcCyberUnknown` stubs exist), `LD_LIBRARY_PATH` workaround and the relinked executable loading, the failure is the same host-libc-binds-to-guest-libc family described here, and additionally: - The guest libc exports ~2926 NIDs and the title's startup reaches PS5 libc++ iostream init (`_ZNSt8__sce_v24coutE` -> `__cxa_demangle` -> `operator new`) before a `bad_alloc` (uncaught, `_ZSt14_Throw_C_errori` path), i.e. the guest allocator returns null during stream init — no video/system module init happens before this point. - LD_PRELOAD interposition confirmed the mechanism anecdotally: stubbing `_Cnd_init`/`_Mtx_init`/`__cxa_atexit` ahead of the host libc changed nothing about the crash, and the missing-export set the title actually hits at runtime is small (a dozen C11/C++ABI imports plus two `libSceAudiodec`/`libSceMsgDialog` NIDs). - Those C11 imports are now implemented in #492 (identified by forward-hashing candidate names with the project's own Nid::Compute; the wrapped `libcCyberUnknown10/12` etc. turn out to be `_Cnd_init`/`_Mtx_init`). Something the experiment here may also want to account for: this title runs Unity IL2CPP, so the module count and `Il2cppUserAssemblies.prx` size stress the guest-module loader far more than PPSA21567 apparently does. Happy to provide the extracted import tables or the relinker diagnostics if useful. (This investigation was AI-assisted — GLM 5.3 via Hermes Agent — and the writeup was reviewed by me.)
Pacuka commented 2026-10-04 17:41:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Pacuka on 2026-10-04T17:41:59Z.


Two more titles that hit this on Linux, both bundling sce_module/libc.prx:

  • PPSA02929 (Dreaming Sarah, Construct): on main 2cf901bc it segfaults in the guest libc's memcpy at startup, the same _Stdout crash. LD_DEBUG=bindings shows the same 34 host-libc → guest-libc bindings. With only libc linked -Bsymbolic (nothing else changed) it boots through the logos and title into gameplay with no skipped draws, so this binding is the only blocker for it. -Bsymbolic-functions alone does not help, confirming _Stdout is the one that matters here.
  • PPSA17221 (Minecraft): the host unwinder's __gxx_personality_v0 reference bound to the guest libc's personality while unwinding a host exception; -Bsymbolic got it past that.

I can reproduce the guest_memory / guest_once / guest_standard_streams failures with -Bsymbolic here too, so I'm not proposing it as the fix; happy to test a proper one against both titles.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5982685561 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5982685561). Originally posted by [Pacuka](https://github.com/Pacuka) on 2026-10-04T17:41:59Z. --- Two more titles that hit this on Linux, both bundling `sce_module/libc.prx`: - **PPSA02929 (Dreaming Sarah, Construct)**: on `main` 2cf901bc it segfaults in the guest libc's `memcpy` at startup, the same `_Stdout` crash. `LD_DEBUG=bindings` shows the same 34 host-libc → guest-libc bindings. With only libc linked `-Bsymbolic` (nothing else changed) it boots through the logos and title into gameplay with no skipped draws, so this binding is the only blocker for it. `-Bsymbolic-functions` alone does not help, confirming `_Stdout` is the one that matters here. - **PPSA17221 (Minecraft)**: the host unwinder's `__gxx_personality_v0` reference bound to the guest libc's personality while unwinding a host exception; `-Bsymbolic` got it past that. I can reproduce the `guest_memory` / `guest_once` / `guest_standard_streams` failures with `-Bsymbolic` here too, so I'm not proposing it as the fix; happy to test a proper one against both titles.
ThisIsAkill commented 2026-10-04 18:39:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T18:39:09Z.


One more test for the -Bsymbolic list: on oneandonlydean's astrobot branch (159b633d), guest_system_font fails the same way when libc is linked -Bsymbolic. A deliberately thrown std::runtime_error (ANYPS5_SYSTEM_FONTS is not a directory) ends in terminate instead of reaching the test's catch. In a default build of the same commit, it passes, as do guest_standard_streams and guest_memory. So any proper fix here should keep exceptions thrown across the libc boundary catchable.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5983151392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5983151392). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-04T18:39:09Z. --- One more test for the `-Bsymbolic` list: on oneandonlydean's `astrobot` branch (159b633d), `guest_system_font` fails the same way when libc is linked `-Bsymbolic`. A deliberately thrown `std::runtime_error` (`ANYPS5_SYSTEM_FONTS is not a directory`) ends in `terminate` instead of reaching the test's `catch`. In a default build of the same commit, it passes, as do `guest_standard_streams` and `guest_memory`. So any proper fix here should keep exceptions thrown across the libc boundary catchable.
ThisIsAkill commented 2026-10-04 21:43:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T21:43:25Z.


Another data point for this issue: oneandonlydean's astrobot branch (159b633d, default build) does not start PPSA21567 either. It crashes in the bundled libc.prx within 2 s, in two launches. With the -Bsymbolic libc it boots. Details: https://github.com/boykopovar/AnyPS5/discussions/357#discussioncomment-18749699

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984698824 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5984698824). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-04T21:43:25Z. --- Another data point for this issue: oneandonlydean's `astrobot` branch (159b633d, default build) does not start PPSA21567 either. It crashes in the bundled `libc.prx` within 2 s, in two launches. With the `-Bsymbolic` libc it boots. Details: https://github.com/boykopovar/AnyPS5/discussions/357#discussioncomment-18749699
oneandonlydean commented 2026-10-05 07:41:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T07:41:06Z.


One more data point. PPSA21564 (Astro Bot, the other region's release of PPSA21567) also ships sce_module/libc.prx. My Linux runs of it have always had that file left out of the guest conversion, so the host libc serves every libc import, and the title runs through the intro, the Crash Site tutorial, the world map and the levels I've tried. That's why the astrobot branch never hit the _Stdout crash. It isn't a fix (excluding modules is a deprecated debugging option, and a title that imports a libc NID the host libc lacks would fail at load), but it fits the picture here: for these titles the startup crash is the binding, not a missing libc feature.

I've opened #618 for the load-failure half (part 1 above): on Linux, when the executable imports libSceLibcInternal.prx and no host libc.prx remains as a dependency, the relinker appends the host libc.prx as the last DT_NEEDED, mirroring WindowsImportBuilder. It keeps the guest-first order for the title's own imports and doesn't touch the interposition (part 2), which still needs its own fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5990211451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-5990211451). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T07:41:06Z. --- One more data point. PPSA21564 (Astro Bot, the other region's release of PPSA21567) also ships `sce_module/libc.prx`. My Linux runs of it have always had that file left out of the guest conversion, so the host libc serves every libc import, and the title runs through the intro, the Crash Site tutorial, the world map and the levels I've tried. That's why the `astrobot` branch never hit the `_Stdout` crash. It isn't a fix (excluding modules is a deprecated debugging option, and a title that imports a libc NID the host libc lacks would fail at load), but it fits the picture here: for these titles the startup crash is the binding, not a missing libc feature. I've opened #618 for the load-failure half (part 1 above): on Linux, when the executable imports `libSceLibcInternal.prx` and no host `libc.prx` remains as a dependency, the relinker appends the host `libc.prx` as the last `DT_NEEDED`, mirroring `WindowsImportBuilder`. It keeps the guest-first order for the title's own imports and doesn't touch the interposition (part 2), which still needs its own fix.
oneandonlydean commented 2026-10-06 05:25:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T05:25:21Z.


Both halves of this are now on main:

  • Load failure (part 1): #618 (ceeab79c). When the executable imports libSceLibcInternal.prx and no host libc.prx is left as a dependency, the relinker appends the host libc.prx as the last DT_NEEDED.
  • Interposition (part 2): #672 (633459b0). It doesn't use -Bsymbolic. On Linux every guest-module export gets a #guest suffix, and so does every import that a guest module satisfies. The title's own imports still bind to the bundled libc first, and host prx can only bind to host definitions. sceKernelDlsym also tries the suffixed name. The -Bsymbolic test failures listed above (guest_memory, guest_standard_streams, guest_once, guest_system_font) don't apply, because the host prx are built as before.

On #672's branch, @Pacuka reported Dreaming Sarah (PPSA02929) booting to the menu with sound instead of segfaulting, and @alfalfa-star reported LEGO Horizon Adventures (PPSA14632) getting past the _Stdout crash.

Could you confirm on main at 633459b0 or later, without LD_LIBRARY_PATH, --exclude-sce-module libc.prx or a -Bsymbolic libc?

  • @ThisIsAkill: PPSA21567
  • @Amielle-Inside: PPSA16951
  • @Pacuka: PPSA17221

If the startup crash is gone for these titles, I'd suggest closing this and opening new issues for anything later in startup. One example is #693, where both libc instances run the heap handshake.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6009968465 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-6009968465). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T05:25:21Z. --- Both halves of this are now on `main`: - Load failure (part 1): #618 (`ceeab79c`). When the executable imports `libSceLibcInternal.prx` and no host `libc.prx` is left as a dependency, the relinker appends the host `libc.prx` as the last `DT_NEEDED`. - Interposition (part 2): #672 (`633459b0`). It doesn't use `-Bsymbolic`. On Linux every guest-module export gets a `#guest` suffix, and so does every import that a guest module satisfies. The title's own imports still bind to the bundled libc first, and host prx can only bind to host definitions. `sceKernelDlsym` also tries the suffixed name. The `-Bsymbolic` test failures listed above (`guest_memory`, `guest_standard_streams`, `guest_once`, `guest_system_font`) don't apply, because the host prx are built as before. On #672's branch, @Pacuka reported Dreaming Sarah (PPSA02929) booting to the menu with sound instead of segfaulting, and @alfalfa-star reported LEGO Horizon Adventures (PPSA14632) getting past the `_Stdout` crash. Could you confirm on `main` at `633459b0` or later, without `LD_LIBRARY_PATH`, `--exclude-sce-module libc.prx` or a `-Bsymbolic` libc? - @ThisIsAkill: PPSA21567 - @Amielle-Inside: PPSA16951 - @Pacuka: PPSA17221 If the startup crash is gone for these titles, I'd suggest closing this and opening new issues for anything later in startup. One example is #693, where both libc instances run the heap handshake.
ThisIsAkill commented 2026-10-06 13:22:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-06T13:22:13Z.


Confirmed on PPSA21567 (Astro Bot), with the caveat about libSceKeyboard.prx below.

Setup: main at 5895ea72 (contains #618 and #672), default build (no -Bsymbolic), PPSA21567 relinked with that tree's relinker, no LD_LIBRARY_PATH, no --exclude-sce-module. Linux, RTX 3070 8 GB, virtual display. Separate build, relink and library folders.

  • Part 1 (libc.prx load failure) and part 2 (interposition): fixed. The libc.prx: cannot open shared object file error is gone, and _Stdout never appears. Two of two runs, 0 occurrences of _Stdout or of any loader or undefined symbol error.
  • A load failure remains on main alone, for another library: libSceKeyboard.prx. libSceVideoOut.prx needs it, and the host prx still have an empty DT_RUNPATH (readelf -d shows Library runpath: [] on libSceVideoOut.prx, libSceKeyboard.prx and libkernel.prx). Without LD_LIBRARY_PATH the executable stops with libSceKeyboard.prx: cannot open shared object file. It's the same cause as part 1 (the runpath isn't inherited), now hit through a host prx that isn't libc. #732 targets it: with #732 merged locally on top of main (1d52422d, local merge, nothing pushed), the host prx report $ORIGIN and the loader finishes.
  • With main + #732 the game then starts rendering and ends 6 to 11 s in with AGC graphics: unsupported descriptor role Gds, in 2 of 2 runs. That is the GDS support from #285, not this issue.

Limits: the clean window is 6 to 11 s (until the Gds error), not a long boot. I haven't tested with #285 stacked.

So, from my side, #476 as filed is resolved. The LD_LIBRARY_PATH workaround only goes away for this title once #732 (or an equivalent) is on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6017206625 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-6017206625). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-06T13:22:13Z. --- Confirmed on PPSA21567 (Astro Bot), with the caveat about `libSceKeyboard.prx` below. Setup: `main` at `5895ea72` (contains #618 and #672), default build (no `-Bsymbolic`), PPSA21567 relinked with that tree's relinker, no `LD_LIBRARY_PATH`, no `--exclude-sce-module`. Linux, RTX 3070 8 GB, virtual display. Separate build, relink and library folders. - **Part 1 (`libc.prx` load failure) and part 2 (interposition): fixed.** The `libc.prx: cannot open shared object file` error is gone, and `_Stdout` never appears. Two of two runs, 0 occurrences of `_Stdout` or of any loader or `undefined symbol` error. - **A load failure remains on `main` alone, for another library: `libSceKeyboard.prx`.** `libSceVideoOut.prx` needs it, and the host prx still have an empty `DT_RUNPATH` (`readelf -d` shows `Library runpath: []` on `libSceVideoOut.prx`, `libSceKeyboard.prx` and `libkernel.prx`). Without `LD_LIBRARY_PATH` the executable stops with `libSceKeyboard.prx: cannot open shared object file`. It's the same cause as part 1 (the runpath isn't inherited), now hit through a host prx that isn't libc. #732 targets it: with #732 merged locally on top of `main` (`1d52422d`, local merge, nothing pushed), the host prx report `$ORIGIN` and the loader finishes. - With `main` + #732 the game then starts rendering and ends 6 to 11 s in with `AGC graphics: unsupported descriptor role Gds`, in 2 of 2 runs. That is the GDS support from #285, not this issue. Limits: the clean window is 6 to 11 s (until the `Gds` error), not a long boot. I haven't tested with #285 stacked. So, from my side, #476 as filed is resolved. The `LD_LIBRARY_PATH` workaround only goes away for this title once #732 (or an equivalent) is on `main`.
EdouardSence commented 2026-10-07 16:46:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-07T16:46:53Z.


Confirmation for PPSA21567 on main 1e5bb880 (includes #618 and #672). Linux (CachyOS, kernel 7.2.8, GCC 16.2.1), RX 9070 XT (RADV).

Relinked with the bundled sce_module/libc.prx converted as a guest module, default libc build, no LD_LIBRARY_PATH, no --exclude-sce-module, no -Bsymbolic. The title loads, has no _Stdout crash, reaches main(), and runs to GPU submission. It stops later on an unrelated shader issue (unsupported descriptor role Gds, #285).

AI-assisted: yes (Claude Code ran the build and wrote this report; the run is on my machine).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6042549968 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-6042549968). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-07T16:46:53Z. --- Confirmation for PPSA21567 on `main` 1e5bb880 (includes #618 and #672). Linux (CachyOS, kernel 7.2.8, GCC 16.2.1), RX 9070 XT (RADV). Relinked with the bundled `sce_module/libc.prx` converted as a guest module, default libc build, no `LD_LIBRARY_PATH`, no `--exclude-sce-module`, no `-Bsymbolic`. The title loads, has no `_Stdout` crash, reaches `main()`, and runs to GPU submission. It stops later on an unrelated shader issue (`unsupported descriptor role Gds`, #285). AI-assisted: yes (Claude Code ran the build and wrote this report; the run is on my machine).
ThisIsAkill commented 2026-10-07 17:26:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-07T17:26:08Z.


With #732 merged, the last workaround is gone for this title too. On main, #618 and #672 fix the libc load and the interposition, and #732 gives the host prx a $ORIGIN runpath, so libSceKeyboard.prx now loads without LD_LIBRARY_PATH. @EdouardSence's run above confirms PPSA21567 on main 1e5bb880 (RADV) with none of the workarounds. My own runs with #732 merged locally showed the same (NVIDIA). Closing. The later stops (Gds, then the #479 class) have their own PRs. Other startup problems belong in new issues, such as #693, where both libc instances run the application-heap handshake.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6043161828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/476#issuecomment-6043161828). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-07T17:26:08Z. --- With #732 merged, the last workaround is gone for this title too. On `main`, #618 and #672 fix the libc load and the interposition, and #732 gives the host prx a `$ORIGIN` runpath, so `libSceKeyboard.prx` now loads without `LD_LIBRARY_PATH`. @EdouardSence's run above confirms PPSA21567 on `main` `1e5bb880` (RADV) with none of the workarounds. My own runs with #732 merged locally showed the same (NVIDIA). Closing. The later stops (`Gds`, then the #479 class) have their own PRs. Other startup problems belong in new issues, such as #693, where both libc instances run the application-heap handshake.
Sign in to join this conversation.
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#476
No description provided.