feat(libSceShare.native): add the four exports the plain library has #1024

Closed
Dextroid17 wants to merge 1 commit from upstream-pr/1024 into main
Dextroid17 commented 2026-10-07 01:17:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T01:17:10Z.


Which title needs this

PPSA12544. Its Share plugin imports sceShareCaptureVideoClipExtended from this library, which is the provenance the closed #989 records for the declaration. A plugin that links libSceShare.native and imports a symbol the wrapper does not export cannot load at all — it stops with undefined symbol before any call is made — so the evidence needed here is that a title imports it, which is what PPSA12544 does, rather than that a title calls it.

The same shape as #992, merged: declaring exports a named title imports and no library provides.

What this does

libSceShare.native exported 13 of the 17 symbols libSceShare exports, so a title importing one of the four stopped at load with an undefined symbol even though the plain library answers it. The wrapper now exports all 17.

Function Behaviour (as libSceShare implements it)
sceShareCaptureScreenshotExtended zeroes the request id, answers ERROR_NOT_SUPPORTED
sceShareCaptureVideoClipExtended NotImplemented_nid_no_patch
sceShareGetRunningStatus NotImplemented_nid_no_patch
sceShareSetContentParamForApplicationTitle NotImplemented_nid_no_patch

Why this shape and not a dependency edge

Context is #906. The plan there was to give each .native wrapper a DT_NEEDED edge to its plain twin, which fails: the wrappers are in the executable's DT_NEEDED, the pairs share NIDs, so the twins enter the global scope and modules rebind to the wrong implementation (that was #1009, closed).

Measuring the pairs first (nm -D --defined-only over a Release build of libs) shows most of that work is unnecessary:

pair plain wrapper shared missing from the wrapper
libSceFont.native 356 356 356 –
libSceAvPlayer.native 30 30 30 –
libSceAudiodec.native 15 15 15 –
libSceShare.native 17 13 → 17 13 → 17 4 NIDs → none
libSceMsgDialog.native 10 11 10 –
libSceSaveDataDialog.native 8 10 8 –
libSceSaveData.native 12 40 11 _ZNKSt5ctypeIcE8do_widenEc
libSceAjm.native 1 37 0 DummyFunction_nid_no_patch
libSceNgs2.native 1 35 0 DummyFunction_nid_no_patch

Eight of the nine wrappers already cover their plain library; the three remaining differences are not NIDs at all (a std::ctype instantiation and the DummyFunction_nid_no_patch placeholder of two libraries with one real export each). libSceShare.native was the only genuine gap, and closing it needs no edge, no second copy of anything in the global scope, and nothing for the pairs to rebind against.

Verification

  • guest_share_extended_tests passes.
  • Full suite: 371/371 (370 on main plus the new test).
  • Symbol measurement from the same build, before and after: the wrapper goes 13 → 17 defined symbols, shared with the plain library 13 → 17, and symbols the plain library has that the wrapper lacks 4 → none.
  • The new test cannot link before the change: the four symbols did not exist.
  • static-free change: nothing existing is modified in behaviour, only four exports are added.

Notes for review

  • The four declarations are appended rather than placed alphabetically, because #967 edits this file a few lines above where sceShareGetRunningStatus would sit. If #967 lands first, this is a trivial rebase. #967 implements sceShareGetCurrentStatus, a different function, so there is no overlap in what is added.
  • No code comments were added. The three throwing paths need no TechnicalDebt line — libSceShare declares them exactly this way.
  • This does not close #906. It removes the only genuine export gap; the original undefined symbol: wTpfglkmv34 is defined in both libSceMsgDialog.prx and libSceMsgDialog.native.prx, so that symptom has a different cause, which I asked about on #906.

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)
  • No investigation .md files or images added to the repository
  • New test registered with ctest and passing

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4766610958 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1024). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T01:17:10Z. --- ## Which title needs this **PPSA12544.** Its Share plugin imports `sceShareCaptureVideoClipExtended` from this library, which is the provenance the closed #989 records for the declaration. A plugin that links `libSceShare.native` and imports a symbol the wrapper does not export cannot load at all — it stops with `undefined symbol` before any call is made — so the evidence needed here is that a title *imports* it, which is what PPSA12544 does, rather than that a title *calls* it. The same shape as #992, merged: declaring exports a named title imports and no library provides. ## What this does `libSceShare.native` exported 13 of the 17 symbols `libSceShare` exports, so a title importing one of the four stopped at load with an undefined symbol even though the plain library answers it. The wrapper now exports all 17. | Function | Behaviour (as `libSceShare` implements it) | | --- | --- | | `sceShareCaptureScreenshotExtended` | zeroes the request id, answers `ERROR_NOT_SUPPORTED` | | `sceShareCaptureVideoClipExtended` | `NotImplemented_nid_no_patch` | | `sceShareGetRunningStatus` | `NotImplemented_nid_no_patch` | | `sceShareSetContentParamForApplicationTitle` | `NotImplemented_nid_no_patch` | ## Why this shape and not a dependency edge Context is #906. The plan there was to give each `.native` wrapper a `DT_NEEDED` edge to its plain twin, which fails: the wrappers are in the executable's `DT_NEEDED`, the pairs share NIDs, so the twins enter the global scope and modules rebind to the wrong implementation (that was #1009, closed). Measuring the pairs first (`nm -D --defined-only` over a Release build of `libs`) shows most of that work is unnecessary: | pair | plain | wrapper | shared | missing from the wrapper | | --- | --- | --- | --- | --- | | libSceFont.native | 356 | 356 | 356 | – | | libSceAvPlayer.native | 30 | 30 | 30 | – | | libSceAudiodec.native | 15 | 15 | 15 | – | | **libSceShare.native** | 17 | 13 → **17** | 13 → **17** | **4 NIDs → none** | | libSceMsgDialog.native | 10 | 11 | 10 | – | | libSceSaveDataDialog.native | 8 | 10 | 8 | – | | libSceSaveData.native | 12 | 40 | 11 | `_ZNKSt5ctypeIcE8do_widenEc` | | libSceAjm.native | 1 | 37 | 0 | `DummyFunction_nid_no_patch` | | libSceNgs2.native | 1 | 35 | 0 | `DummyFunction_nid_no_patch` | Eight of the nine wrappers already cover their plain library; the three remaining differences are not NIDs at all (a `std::ctype` instantiation and the `DummyFunction_nid_no_patch` placeholder of two libraries with one real export each). `libSceShare.native` was the only genuine gap, and closing it needs no edge, no second copy of anything in the global scope, and nothing for the pairs to rebind against. ## Verification - `guest_share_extended_tests` passes. - Full suite: **371/371** (370 on `main` plus the new test). - Symbol measurement from the same build, before and after: the wrapper goes 13 → 17 defined symbols, shared with the plain library 13 → 17, and symbols the plain library has that the wrapper lacks 4 → **none**. - The new test cannot link before the change: the four symbols did not exist. - `static`-free change: nothing existing is modified in behaviour, only four exports are added. ## Notes for review - The four declarations are **appended** rather than placed alphabetically, because #967 edits this file a few lines above where `sceShareGetRunningStatus` would sit. If #967 lands first, this is a trivial rebase. #967 implements `sceShareGetCurrentStatus`, a different function, so there is no overlap in what is added. - No code comments were added. The three throwing paths need no TechnicalDebt line — `libSceShare` declares them exactly this way. - This does not close #906. It removes the only genuine export gap; the original `undefined symbol: wTpfglkmv34` is defined in **both** `libSceMsgDialog.prx` and `libSceMsgDialog.native.prx`, so that symptom has a different cause, which I asked about on #906. ## 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`) - [x] No investigation `.md` files or images added to the repository - [x] New test registered with ctest and passing AI-assisted: yes.
github-actions[bot] commented 2026-10-07 01:17:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T01:17:32Z.


Progress report (ee391a5 → a84acf0)

📉 System libraries: 86.53% (-0.09%, +1 implemented, +3 declared functions)

✅ 1 implemented
Library Name
libSceShare.native sceShareCaptureScreenshotExtended
🆕 3 declared as stubs
Library Name
libSceShare.native sceShareCaptureVideoClipExtended
libSceShare.native sceShareGetRunningStatus
libSceShare.native sceShareSetContentParamForApplicationTitle
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028786392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1024#issuecomment-6028786392). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T01:17:32Z. --- <!-- progress-report --> ### Progress report (ee391a5 → a84acf0) 📉 **System libraries**: 86.53% (-0.09%, +1 implemented, +3 declared functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceShare.native | `sceShareCaptureScreenshotExtended` | </details> <details> <summary>🆕 3 declared as stubs</summary> | Library | Name | | - | - | | libSceShare.native | `sceShareCaptureVideoClipExtended` | | libSceShare.native | `sceShareGetRunningStatus` | | libSceShare.native | `sceShareSetContentParamForApplicationTitle` | </details>
Dextroid17 commented 2026-10-07 01:30:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T01:30:37Z.


The first Windows run failed in cmake --build build:

ld.exe: GuestShareExtended.cpp.obj:GuestShareExtended.cpp:(.data+0x8):
  undefined reference to `__gxx_personality_v0'

The test's try/catch needs the C++ runtime, and the test linked only libSceShare.native, which is a plain C-style export library, so nothing pulled libstdc++ in. Every other test in this tree that catches an exception links libc as well for exactly that reason (guest_ajm_tests, guest_aio_tests, guest_buffer_reuse_tests, guest_jpeg_enc_tests, ngs2_geom_tests), so this now does too, and the link pulls libstdc++.so.6.

No change to the library or the exports. Linux was already green; the suite is 371/371 locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028934264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1024#issuecomment-6028934264). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T01:30:37Z. --- The first Windows run failed in `cmake --build build`: ``` ld.exe: GuestShareExtended.cpp.obj:GuestShareExtended.cpp:(.data+0x8): undefined reference to `__gxx_personality_v0' ``` The test's `try`/`catch` needs the C++ runtime, and the test linked only `libSceShare.native`, which is a plain C-style export library, so nothing pulled `libstdc++` in. Every other test in this tree that catches an exception links `libc` as well for exactly that reason (`guest_ajm_tests`, `guest_aio_tests`, `guest_buffer_reuse_tests`, `guest_jpeg_enc_tests`, `ngs2_geom_tests`), so this now does too, and the link pulls `libstdc++.so.6`. No change to the library or the exports. Linux was already green; the suite is 371/371 locally.
Dextroid17 commented 2026-10-07 01:42:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T01:42:42Z.


Worth stating up front, because #989 (now closed) implemented one of these four in the plain library and this PR touches the same function.

That closure was right for its own case: nothing on main stops at sceShareCaptureVideoClipExtended, so implementing its behaviour had no evidence behind it. This PR does not change that function's behaviour. All three unimplemented ones are declared as NotImplemented_nid_no_patch, exactly as libSceShare already declares them, and sceShareCaptureScreenshotExtended is copied value for value from the plain library, which #989's review already called consistent.

What is fixed here is reachability, which fails differently. A title's Share plugin that links libSceShare.native and imports sceShareCaptureVideoClipExtended cannot load at all while the wrapper does not export it — it stops with undefined symbol before any call happens. So the evidence this needs is that a title imports it, not that a title calls it, and that is exactly the provenance #989 records: PPSA12544's Share plugin imports sceShareCaptureVideoClipExtended.

That is the same shape as #992, merged today — declaring exports a named title imports that no library provides.

For completeness on the other three, libSceShare declares them all, and the wrapper is the library a title actually links:

function in libSceShare now in libSceShare.native
sceShareCaptureScreenshotExtended implemented (ERROR_NOT_SUPPORTED) same
sceShareCaptureVideoClipExtended NotImplemented_nid_no_patch same
sceShareGetRunningStatus NotImplemented_nid_no_patch same
sceShareSetContentParamForApplicationTitle NotImplemented_nid_no_patch same

If the direction you prefer is to leave the wrapper short until a title log shows the load failing, say so and I will close this — but the failure mode here is a load that cannot start, so a log line would be the absence of one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6029069734 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1024#issuecomment-6029069734). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T01:42:42Z. --- Worth stating up front, because #989 (now closed) implemented one of these four in the **plain** library and this PR touches the same function. That closure was right for its own case: nothing on `main` stops at `sceShareCaptureVideoClipExtended`, so implementing its behaviour had no evidence behind it. **This PR does not change that function's behaviour.** All three unimplemented ones are declared as `NotImplemented_nid_no_patch`, exactly as `libSceShare` already declares them, and `sceShareCaptureScreenshotExtended` is copied value for value from the plain library, which #989's review already called consistent. What is fixed here is **reachability**, which fails differently. A title's Share plugin that links `libSceShare.native` and imports `sceShareCaptureVideoClipExtended` cannot load at all while the wrapper does not export it — it stops with `undefined symbol` before any call happens. So the evidence this needs is that a title **imports** it, not that a title **calls** it, and that is exactly the provenance #989 records: PPSA12544's Share plugin imports `sceShareCaptureVideoClipExtended`. That is the same shape as #992, merged today — declaring exports a named title imports that no library provides. For completeness on the other three, `libSceShare` declares them all, and the wrapper is the library a title actually links: | function | in `libSceShare` | now in `libSceShare.native` | | --- | --- | --- | | `sceShareCaptureScreenshotExtended` | implemented (`ERROR_NOT_SUPPORTED`) | same | | `sceShareCaptureVideoClipExtended` | `NotImplemented_nid_no_patch` | same | | `sceShareGetRunningStatus` | `NotImplemented_nid_no_patch` | same | | `sceShareSetContentParamForApplicationTitle` | `NotImplemented_nid_no_patch` | same | If the direction you prefer is to leave the wrapper short until a title log shows the load failing, say so and I will close this — but the failure mode here is a load that cannot start, so a log line would be the absence of one.
oneandonlydean commented 2026-10-07 02:04:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T02:04:56Z.


Thanks for laying that out; the distinction between calling and importing is fair, and #992 was the same shape.

The difference is that on #992 no library provided those exports, while here libSceShare already does. On #228 the owner's point was that a title importing libSceAjm also loads libSceAjm.native, so a copy in the twin isn't needed. If that's true for Share too, PPSA12544's plugin resolves these four from the plain library and loads fine on main.

A load that can't start does leave a log line: the loader prints undefined symbol: <name> (or the NotImplemented-style stop) with the module that asked for it. If you can run PPSA12544 on main and it stops there, please post that line and I'll reopen this straight away; it would also tell us whether the fix belongs in the twin or in how the plain library is found. Until then I'm closing it, since the evidence so far is the import list.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6029338196 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1024#issuecomment-6029338196). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-07T02:04:56Z. --- Thanks for laying that out; the distinction between calling and importing is fair, and #992 was the same shape. The difference is that on #992 no library provided those exports, while here `libSceShare` already does. On #228 the owner's point was that a title importing `libSceAjm` also loads `libSceAjm.native`, so a copy in the twin isn't needed. If that's true for Share too, PPSA12544's plugin resolves these four from the plain library and loads fine on main. A load that can't start does leave a log line: the loader prints `undefined symbol: <name>` (or the `NotImplemented`-style stop) with the module that asked for it. If you can run PPSA12544 on main and it stops there, please post that line and I'll reopen this straight away; it would also tell us whether the fix belongs in the twin or in how the plain library is found. Until then I'm closing it, since the evidence so far is the import list.
Dextroid17 commented 2026-10-07 11:20:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T11:20:06Z.


@jeffrey12cali, who filed #906 and runs the title that hit it, has asked for this to land — after this was closed, in a comment on that issue:

Please land the libSceShare fix - I would rather have that than any scoping change, and I will not duplicate it.
… only libSceShare.native is left incomplete, which is what your PR fixes.

He also explains the discrepancy we were both measuring, and it is a snapshot difference rather than either of us being wrong: he is pinned to sos-v0.2.2 (c8830699), where libSceMsgDialog.native exported 5 symbols with wTpfglkmv34 absent — that is the undefined symbol which opened #906 — while on main the wrapper declares it. So an edge genuinely is not needed for that pair, and the only pair still short is this one.

His side is a temporary stopgap, and he says it comes out on its own: tools/sos_linux/twinscope.py replaces the importing module's DT_NEEDED name with the plain twin's, purely because they are pinned to that release — "when we re-pin onto main it comes out: the wrapper already answers the import, and your PR closes the last pair."

So this is not the PPSA12544 log line you asked for, and I am not claiming it is. It is the title-side author saying he wants this rather than the scoping change, which is the question the close turned on.

If that is enough, say so and I will reopen, rebase and re-run; if you would rather still wait for the plugin's own undefined symbol line, I will leave it closed and say as much on #906 so the thread does not wait on me.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6036830654 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1024#issuecomment-6036830654). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T11:20:06Z. --- **@jeffrey12cali, who filed #906 and runs the title that hit it, has asked for this to land** — after this was closed, in a comment on that issue: > Please land the `libSceShare` fix - I would rather have that than any scoping change, and I will not duplicate it. > … only `libSceShare.native` is left incomplete, **which is what your PR fixes**. He also explains the discrepancy we were both measuring, and it is a snapshot difference rather than either of us being wrong: he is pinned to `sos-v0.2.2` (`c8830699`), where `libSceMsgDialog.native` exported 5 symbols with `wTpfglkmv34` **absent** — that is the `undefined symbol` which opened #906 — while on `main` the wrapper declares it. So an edge genuinely is not needed for that pair, and the only pair still short is this one. His side is a temporary stopgap, and he says it comes out on its own: `tools/sos_linux/twinscope.py` *replaces* the importing module's `DT_NEEDED` name with the plain twin's, purely because they are pinned to that release — "when we re-pin onto `main` it comes out: the wrapper already answers the import, and your PR closes the last pair." So this is not the PPSA12544 log line you asked for, and I am not claiming it is. It is the title-side author saying he wants this rather than the scoping change, which is the question the close turned on. If that is enough, say so and I will reopen, rebase and re-run; if you would rather still wait for the plugin's own `undefined symbol` line, I will leave it closed and say as much on #906 so the thread does not wait on me.

Pull request closed

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!1024
No description provided.