Skip to content

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

Closed
krishalivaibhav wants to merge 1 commit into
boykopovar:mainfrom
krishalivaibhav:fix/macos-libscessl-hide-mbedtls
Closed

krishalivaibhav wants to merge 1 commit into
boykopovar:mainfrom
krishalivaibhav:fix/macos-libscessl-hide-mbedtls

Conversation

@krishalivaibhav

Copy link
Copy Markdown
Contributor

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 fix(libkernel): build the file, module and rtld calls on macOS hosts #10552 and the PRs above. The two transport tests also need fix(macos): read application process parameters from Mach-O images #10876
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

Apple ld has no --exclude-libs, so the prx's mbedtls copy was bound to the
one linked into test executables, and its pool allocator (installed with
mbedtls_platform_set_calloc_free) served the test server's threads, which
have no pool. Unexport the mbedtls symbols on Apple.

Co-authored-by: Himansh Raj <iamthehimansh@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

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 10530 core/libs/prx/libSceSsl/CMakeLists.txt L62

@krishalivaibhav

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #10530 (maximilianfv), which fixes the same mbedtls symbol clash and was opened first.

For #10530: on M2 (macOS 27.2, x86_64 Release), with the mbedtls symbols kept out of libSceSsl's exports and #10876 applied, guest_ssl_transport_kernel and guest_ssl_transport_net pass. Without that, they fail.

AI-assisted: yes (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant