fix(prx): build the macOS libraries on current main #16591

Merged
Gonic0 merged 1 commit from upstream-pr/16591 into main 2026-11-11 01:30:15 +00:00
Gonic0 commented 2026-11-07 07:45:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gonic0 on 2026-11-07T07:45:42Z.


What

Clang on macOS rejects five spots on main, and the NID patcher stops on two libraries. None of this changes what Linux or Windows build, because size_t and std::uint64_t are the same type there and the CMake change is under APPLE.

unsigned long and unsigned long long are distinct on macOS:

  • sceAppContentDownload1Expand passes a size_t to compare_exchange_weak on an atomic std::uint64_t. sceAppContentDownload2Expand already uses std::uint64_t.
  • Two libSceNpCppWebApi Vector::size definitions return std::size_t where Api.hpp declares std::uint64_t.

Headers on macOS do not provide what two files use:

  • RunReport.cpp uses std::thread without <thread>.
  • VulkanDevice.cpp reads ::environ, which macOS does not declare. It is declared as in FrameRecorder.cpp, HostReportSources.cpp and PerformanceTrace.cpp.

libSceFreeTypeOt and libfreetype export FreeType's own symbols on macOS next to their _nid_ definitions, so MachONidPatcher stops on duplicate patched export name. Linked without the filter, libfreetype exports 170 symbols, 38 of them _nid_ and 132 _FT_*. Both now export only *_nid_* on Apple, as libSceFreeTypeOl does, the counterpart of --exclude-libs on Linux and MinGW.

Tested

macOS 27.3, Apple M5 Pro, Apple clang, x86_64 Release under Rosetta 2. Tree: main 4ff82bf4e6 with #4630 and #7804, which macOS still needs to build.

  • Without this change: ninja -k 0 libs relinker stops with 3 failed objects and 4 compile errors (Export.cpp:333 in libSceAppContent, Export.cpp:6787 and :6795 in libSceNpCppWebApi, RunReport.cpp:1307). With those fixed, VulkanDevice.cpp:2552 fails, and then the patcher stops on libSceFreeTypeOt.prx and libfreetype.prx.
  • With this change: libs and relinker build with no failures.
  • Tests: 97 of 97 pass (ctest -R "run_report|guest_appcontent|guest_np_cpp_web_api|freetype").
  • Linux and Windows: not built locally.

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
  • 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, the only AGC change is a declaration
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5199589651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16591). Originally posted by [Gonic0](https://github.com/Gonic0) on 2026-11-07T07:45:42Z. --- ### What Clang on macOS rejects five spots on `main`, and the NID patcher stops on two libraries. None of this changes what Linux or Windows build, because `size_t` and `std::uint64_t` are the same type there and the CMake change is under `APPLE`. `unsigned long` and `unsigned long long` are distinct on macOS: - `sceAppContentDownload1Expand` passes a `size_t` to `compare_exchange_weak` on an atomic `std::uint64_t`. `sceAppContentDownload2Expand` already uses `std::uint64_t`. - Two `libSceNpCppWebApi` `Vector::size` definitions return `std::size_t` where `Api.hpp` declares `std::uint64_t`. Headers on macOS do not provide what two files use: - `RunReport.cpp` uses `std::thread` without `<thread>`. - `VulkanDevice.cpp` reads `::environ`, which macOS does not declare. It is declared as in `FrameRecorder.cpp`, `HostReportSources.cpp` and `PerformanceTrace.cpp`. `libSceFreeTypeOt` and `libfreetype` export FreeType's own symbols on macOS next to their `_nid_` definitions, so `MachONidPatcher` stops on `duplicate patched export name`. Linked without the filter, `libfreetype` exports 170 symbols, 38 of them `_nid_` and 132 `_FT_*`. Both now export only `*_nid_*` on Apple, as `libSceFreeTypeOl` does, the counterpart of `--exclude-libs` on Linux and MinGW. ### Tested macOS 27.3, Apple M5 Pro, Apple clang, x86_64 Release under Rosetta 2. Tree: `main` `4ff82bf4e6` with #4630 and #7804, which macOS still needs to build. - Without this change: `ninja -k 0 libs relinker` stops with 3 failed objects and 4 compile errors (`Export.cpp:333` in `libSceAppContent`, `Export.cpp:6787` and `:6795` in `libSceNpCppWebApi`, `RunReport.cpp:1307`). With those fixed, `VulkanDevice.cpp:2552` fails, and then the patcher stops on `libSceFreeTypeOt.prx` and `libfreetype.prx`. - With this change: `libs` and `relinker` build with no failures. - Tests: 97 of 97 pass (`ctest -R "run_report|guest_appcontent|guest_np_cpp_web_api|freetype"`). - Linux and Windows: not built locally. ### 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) - [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, the only AGC change is a declaration - [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!16591
No description provided.