build(libSceAudioIn): keep --exclude-libs off Apple's linker #10669

Merged
imellag merged 1 commit from upstream-pr/10669 into main 2026-10-29 10:04:36 +00:00
imellag commented 2026-10-24 16:16:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-10-24T16:16:31Z.


What

libSceAudioIn passes --exclude-libs,ALL to the linker on every host. Apple's ld64 doesn't know that option, so once libkernel builds on macOS, libSceAudioIn.prx fails to link:

ld: unknown options: --exclude-libs
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

With this change the option is no longer passed on Apple, and every other host keeps it as before. Other libraries that pass the option (libSceSsl, libSceFreeType, libSceVorbisDec, libSceUsbd, libSceAgcDriver) already leave it out on Apple.

On macOS, libSceAudioIn now exports the symbols of its static SDL2, as libSceAudioOut, libSceVideoOut and libSceAgcDriver already do on main. This PR doesn't change how the libraries share SDL on macOS.

Overlap:

  • #7201 contains the same hunk, byte for byte, so whichever lands second merges cleanly. Its head (6687cbac29, 2026-10-16) conflicts with main and needs a rebase anyway. The order I propose: this PR first, with #7201 keeping main's block at its rebase. If #7201 lands first, this PR isn't needed and I will close it.
  • 63db337cd8 in mugurc's macOS series (not in an open PR) links libSceAudioIn and libSceAudioOut to libSceAgcDriver's SDL on Apple. That is the better end state, but libSceAgcDriver doesn't build on macOS on main yet; that change would replace these lines.
  • #5021 replaces these lines on Apple with a link to libSceAgcDriver. It already conflicts with main, and its rebase would take its own version of the block.

Tested

Current main (2026-10-26): I looked for the smallest set of open PRs that boots titles on macOS from main 035ac96edd: #10366, #10552, #7631, #7804, #11249, this PR, #10540, #11447, #11047, #11048, #10876 and #9263, plus a local VulkanDevice.cpp patch that no open PR covers yet. With it, Planet of Lana and God of War Sons of Sparta, relinked with that tree, start from New Game and run without errors (Lana in gameplay for 120 s, GoW to the Cyclops fight in 145 s). Without this PR, libSceAudioIn doesn't link: ld: unknown options: --exclude-libs.

Apple M4 Pro, macOS 27.0.1, Apple clang, x86-64 Release (-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja, BUILD_TESTING=ON).

libSceAudioIn links against libkernel, which doesn't build on main on macOS yet. So I built it on main 3fcb5e4d76 with the open macOS build PRs applied: #10562, #10641, #10366, #10419, #7631, #7804, #10552, #4630, #10659 and #10660, with the conflicts of #10552 and #4630 resolved locally.

  • Without this change, the link fails with the error above.
  • With it, libSceAudioIn.prx links and guest_audio_in_capture and guest_audio_in_no_device pass.

Not built on Linux or Windows; the condition is true there, so they link as before.

check_conventions.py --base upstream/main passes. pr_overlap.py lists #7201 and #5021 as pull requests it couldn't compare on this file because they conflict with main; both are covered above.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4997021340 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10669). Originally posted by [imellag](https://github.com/imellag) on 2026-10-24T16:16:31Z. --- ### What `libSceAudioIn` passes `--exclude-libs,ALL` to the linker on every host. Apple's ld64 doesn't know that option, so once `libkernel` builds on macOS, `libSceAudioIn.prx` fails to link: ``` ld: unknown options: --exclude-libs clang++: error: linker command failed with exit code 1 (use -v to see invocation) ``` With this change the option is no longer passed on Apple, and every other host keeps it as before. Other libraries that pass the option (`libSceSsl`, `libSceFreeType`, `libSceVorbisDec`, `libSceUsbd`, `libSceAgcDriver`) already leave it out on Apple. On macOS, `libSceAudioIn` now exports the symbols of its static SDL2, as `libSceAudioOut`, `libSceVideoOut` and `libSceAgcDriver` already do on `main`. This PR doesn't change how the libraries share SDL on macOS. Overlap: - **#7201** contains the same hunk, byte for byte, so whichever lands second merges cleanly. Its head (`6687cbac29`, 2026-10-16) conflicts with `main` and needs a rebase anyway. The order I propose: this PR first, with #7201 keeping `main`'s block at its rebase. If #7201 lands first, this PR isn't needed and I will close it. - **`63db337cd8`** in mugurc's macOS series (not in an open PR) links `libSceAudioIn` and `libSceAudioOut` to `libSceAgcDriver`'s SDL on Apple. That is the better end state, but `libSceAgcDriver` doesn't build on macOS on `main` yet; that change would replace these lines. - **#5021** replaces these lines on Apple with a link to `libSceAgcDriver`. It already conflicts with `main`, and its rebase would take its own version of the block. ### Tested **Current `main` (2026-10-26):** I looked for the smallest set of open PRs that boots titles on macOS from `main` `035ac96edd`: #10366, #10552, #7631, #7804, #11249, this PR, #10540, #11447, #11047, #11048, #10876 and #9263, plus a local `VulkanDevice.cpp` patch that no open PR covers yet. With it, Planet of Lana and God of War Sons of Sparta, relinked with that tree, start from New Game and run without errors (Lana in gameplay for 120 s, GoW to the Cyclops fight in 145 s). Without this PR, `libSceAudioIn` doesn't link: `ld: unknown options: --exclude-libs`. Apple M4 Pro, macOS 27.0.1, Apple clang, x86-64 Release (`-DCMAKE_OSX_ARCHITECTURES=x86_64`, Ninja, `BUILD_TESTING=ON`). `libSceAudioIn` links against `libkernel`, which doesn't build on `main` on macOS yet. So I built it on `main` `3fcb5e4d76` with the open macOS build PRs applied: #10562, #10641, #10366, #10419, #7631, #7804, #10552, #4630, #10659 and #10660, with the conflicts of #10552 and #4630 resolved locally. - Without this change, the link fails with the error above. - With it, `libSceAudioIn.prx` links and `guest_audio_in_capture` and `guest_audio_in_no_device` pass. Not built on Linux or Windows; the condition is true there, so they link as before. `check_conventions.py --base upstream/main` passes. `pr_overlap.py` lists #7201 and #5021 as pull requests it couldn't compare on this file because they conflict with `main`; both are covered above. ### 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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-24 16:22:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T16:22:17Z.

Review: CHANGES_REQUESTED


The exact libSceAudioIn/CMakeLists.txt hunk in this PR is already present in the open #7201 (verified against its current diff); the change is byte-for-byte identical. Because #7201 remains open, a second PR carrying this same fix duplicates existing work, which the contribution rules prohibit. Please coordinate with the existing PR author/maintainers on how they want this fix integrated, or re-scope this PR to a distinct, independently useful change. I am not asking anyone to close #7201 or making a judgment about its broader status; I cannot approve a parallel copy of the same hunk.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638938689 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10669#pullrequestreview-5638938689). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T16:22:17Z. **Review:** CHANGES_REQUESTED --- The exact libSceAudioIn/CMakeLists.txt hunk in this PR is already present in the open #7201 (verified against its current diff); the change is byte-for-byte identical. Because #7201 remains open, a second PR carrying this same fix duplicates existing work, which the contribution rules prohibit. Please coordinate with the existing PR author/maintainers on how they want this fix integrated, or re-scope this PR to a distinct, independently useful change. I am not asking anyone to close #7201 or making a judgment about its broader status; I cannot approve a parallel copy of the same hunk.
THEMANnt commented 2026-10-26 19:16:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-26T19:16:13Z.

Review: APPROVED


Reviewed 6aa0ef1bb28ae254a0924c57df5b00e2bc72fdf3. Approve; no actionable finding in this focused review.

Only Apple builds omit LINKER:--exclude-libs,ALL; the AudioIn library and existing SDL linkage remain registered. Linux and Windows retain the GNU linker option.

Validation: Executed the submitted CMake on head/base across Darwin, Linux and Windows branches and inspected the recorded link options. Only the intended Darwin option differs.

Scope / next step: No native Apple AudioIn link or capture session was performed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5657675826 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10669#pullrequestreview-5657675826). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-26T19:16:13Z. **Review:** APPROVED --- Reviewed `6aa0ef1bb28ae254a0924c57df5b00e2bc72fdf3`. Approve; no actionable finding in this focused review. Only Apple builds omit LINKER:--exclude-libs,ALL; the AudioIn library and existing SDL linkage remain registered. Linux and Windows retain the GNU linker option. **Validation:** Executed the submitted CMake on head/base across Darwin, Linux and Windows branches and inspected the recorded link options. Only the intended Darwin option differs. **Scope / next step:** No native Apple AudioIn link or capture session was performed.
adriadam10 commented 2026-10-26 21:35:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T21:35:29Z.

Review: CHANGES_REQUESTED


The change itself checks out: only Apple drops --exclude-libs,ALL, matching the other libraries that already do so, and Linux/Windows keep it. Reports from @krishalivaibhav (M2) and @THEMANnt agree.

The one blocker is @MarcZX10's open change request on this head: the hunk is identical to the one in #7201, and the agreement on order is still missing.

  • Please get a confirmation from the owner of #7201 (@marion909) that this lands first and that #7201 keeps main's block when it rebases, or ask @MarcZX10 to withdraw the request given the hunk is byte-identical and merges cleanly in either order. Once that is on the thread this is ready to merge.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5659407611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10669#pullrequestreview-5659407611). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-26T21:35:29Z. **Review:** CHANGES_REQUESTED --- The change itself checks out: only Apple drops `--exclude-libs,ALL`, matching the other libraries that already do so, and Linux/Windows keep it. Reports from @krishalivaibhav (M2) and @THEMANnt agree. The one blocker is @MarcZX10's open change request on this head: the hunk is identical to the one in #7201, and the agreement on order is still missing. - Please get a confirmation from the owner of #7201 (@marion909) that this lands first and that #7201 keeps `main`'s block when it rebases, or ask @MarcZX10 to withdraw the request given the hunk is byte-identical and merges cleanly in either order. Once that is on the thread this is ready to merge.
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!10669
No description provided.