fix(macos): hide libSceSsl's static mbedtls symbols #10877

Closed
krishalivaibhav wants to merge 1 commit from upstream-pr/10877 into main
krishalivaibhav commented 2026-10-25 07:10:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-25T07:10:15Z.


What

On Linux and MinGW, libSceSsl links its static mbedtls with --exclude-libs,ALL. Apple ld has no such option, so on macOS the prx exported its mbedtls symbols and the dynamic linker bound them to the copy linked into the test executables. The prx's pool allocator, which is installed with mbedtls_platform_set_calloc_free, then served the test server's threads, which have no pool, and guest_ssl_transport_kernel and guest_ssl_transport_net failed.

This PR adds an elseif(APPLE) branch that links with -unexported_symbol,_mbedtls_*. The existing Linux/MinGW branch is unchanged. The approach follows iamthehimansh's feat/macos-port (#8658), and iamthehimansh is credited as co-author.

Tested

macOS: Apple Silicon M2, macOS 27.2, AppleClang, x86_64 Release, on a local integration of main + #10419 + #10366 + #10369 + #7631 + #7804 + #4630 + #10552 + #10853 + #10876 + this commit:

  • guest_ssl_transport_kernel and guest_ssl_transport_net pass. Without this commit, they fail;
  • guest_ssl, guest_ssl_load, guest_ssl_ps5_readers, guest_http, guest_http2, guest_http_options and guest_http_response_header pass;
  • ctest -R '^(guest_|libc_|libkernel_)': no new failures.

Linux/Windows: not built locally. Only an Apple branch is added.

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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none to review; building on macOS needs #10552 and the PRs above. The two transport tests also need #10876
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5002648427 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10877). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-25T07:10:15Z. --- ### What On Linux and MinGW, `libSceSsl` links its static mbedtls with `--exclude-libs,ALL`. Apple ld has no such option, so on macOS the prx exported its mbedtls symbols and the dynamic linker bound them to the copy linked into the test executables. The prx's pool allocator, which is installed with `mbedtls_platform_set_calloc_free`, then served the test server's threads, which have no pool, and `guest_ssl_transport_kernel` and `guest_ssl_transport_net` failed. This PR adds an `elseif(APPLE)` branch that links with `-unexported_symbol,_mbedtls_*`. The existing Linux/MinGW branch is unchanged. The approach follows iamthehimansh's `feat/macos-port` (#8658), and iamthehimansh is credited as co-author. ### Tested macOS: Apple Silicon M2, macOS 27.2, AppleClang, x86_64 Release, on a local integration of `main` + #10419 + #10366 + #10369 + #7631 + #7804 + #4630 + #10552 + #10853 + #10876 + this commit: - `guest_ssl_transport_kernel` and `guest_ssl_transport_net` pass. Without this commit, they fail; - `guest_ssl`, `guest_ssl_load`, `guest_ssl_ps5_readers`, `guest_http`, `guest_http2`, `guest_http_options` and `guest_http_response_header` pass; - `ctest -R '^(guest_|libc_|libkernel_)'`: no new failures. Linux/Windows: not built locally. Only an Apple branch is added. ### 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`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none to review; building on macOS needs #10552 and the PRs above. The two transport tests also need #10876 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)

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