fix(libSceFreeTypeOl): export only NID symbols on macOS #14883

Merged
Gonic0 merged 1 commit from upstream-pr/14883 into main 2026-11-03 05:11:33 +00:00
Gonic0 commented 2026-11-01 22:19:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gonic0 on 2026-11-01T22:19:01Z.


What

On Linux and MinGW, libSceFreeTypeOl links FreeType with --exclude-libs,ALL, so only the module's own exports reach the NID patcher. ld64 has no equivalent, so on macOS every FT_* symbol of the static FreeType is exported as well.

The native FT_Add_Module patches to LonHHN98tMI, which the module already exports for sceFreeTypeOlAddModule. The patcher then stops:

FAIL: .../libs/libSceFreeTypeOl.prx: duplicate patched export name: _LonHHN98tMI

This PR adds -exported_symbol,*_nid_* for Apple, the same filter #9848 adds for libSceFreeType.

Tested

Tested on macOS 27.2 with an Apple M5 Pro and AppleClang, building x86_64 for Rosetta 2.

main does not build libkernel on macOS, so the module was built on a tree with this commit applied over local macOS build fixes:

  • Negative control: without the line, libSceFreeTypeOl.prx fails NID patching with the error above.
  • With the line: the patch succeeds. The unpatched module exports 187 symbols, all of them *_nid_*.
  • Tests: guest_freetype_ol_modules and the 9 guest_freetype_outline_border_* tests (raw and patched, Ol and Ot) pass.

Overlap: #9848 covers libSceFreeType only and does not touch this file.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5112137758 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14883). Originally posted by [Gonic0](https://github.com/Gonic0) on 2026-11-01T22:19:01Z. --- ### What On Linux and MinGW, `libSceFreeTypeOl` links FreeType with `--exclude-libs,ALL`, so only the module's own exports reach the NID patcher. ld64 has no equivalent, so on macOS every `FT_*` symbol of the static FreeType is exported as well. The native `FT_Add_Module` patches to `LonHHN98tMI`, which the module already exports for `sceFreeTypeOlAddModule`. The patcher then stops: ```text FAIL: .../libs/libSceFreeTypeOl.prx: duplicate patched export name: _LonHHN98tMI ``` This PR adds `-exported_symbol,*_nid_*` for Apple, the same filter #9848 adds for `libSceFreeType`. ### Tested Tested on macOS 27.2 with an Apple M5 Pro and AppleClang, building x86_64 for Rosetta 2. `main` does not build libkernel on macOS, so the module was built on a tree with this commit applied over local macOS build fixes: - **Negative control:** without the line, `libSceFreeTypeOl.prx` fails NID patching with the error above. - **With the line:** the patch succeeds. The unpatched module exports 187 symbols, all of them `*_nid_*`. - **Tests:** `guest_freetype_ol_modules` and the 9 `guest_freetype_outline_border_*` tests (raw and patched, Ol and Ot) pass. Overlap: #9848 covers `libSceFreeType` only and does not touch this file. ### 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](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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!14883
No description provided.