Skip to content

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

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Gonic0:fix/macos-prx-build
Nov 11, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Gonic0:fix/macos-prx-build

Conversation

@Gonic0

@Gonic0 Gonic0 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

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

Clang on macOS rejects five spots on main that GCC and MinGW accept, and
the NID patcher rejects two libraries.

unsigned long and unsigned long long are distinct on macOS, so size_t
and std::uint64_t do not convert through a pointer or a redeclaration:
- sceAppContentDownload1Expand passes a size_t to compare_exchange_weak
  on an atomic uint64_t. Download2Expand already uses std::uint64_t.
- Two libSceNpCppWebApi Vector::size definitions return std::size_t
  where Api.hpp declares std::uint64_t.

libc++ and macOS headers do not pull in what these files use:
- RunReport.cpp uses std::thread without <thread>.
- VulkanDevice.cpp reads ::environ, which macOS does not declare. Declare
  it as FrameRecorder.cpp, HostReportSources.cpp and PerformanceTrace.cpp
  do.

libSceFreeTypeOt and libfreetype statically link FreeType and leak its
symbols, so the patcher stops on a duplicate export name. Export only the
NID symbols on Apple, as libSceFreeTypeOl does, which is the counterpart
of the --exclude-libs the two libraries use on Linux and MinGW.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JJenkx

JJenkx commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Windows regression check of head 82c4d630f2, merged onto main c2ce41cdc5 (5779f681ce, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. I did not test macOS.

  • The six touched libraries build: libSceAgcDriver, libSceAppContent, libSceFreeTypeOt, libSceNpCppWebApi, libc and libfreetype.
  • 89 tests for them pass in 3 of 3 runs, none skipped: guest_freetype_*, guest_np_cpp_web_api_*, guest_appcontent*, run_report and run_report_revision.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 7, 2026 •

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 16798 _ZNK3sce2Np9CppWebApi6Common6VectorINS2_12IntrusivePtrINS1_13InGameCatalog2V57ProductEEEE4sizeEv
_ZNK3sce2Np9CppWebApi6Common6VectorINS2_12IntrusivePtrINS1_14SessionManager2V120PlayerSessionForReadEEEE4sizeEv

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7002 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7464 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7643 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9289 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10351 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10678 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12855 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12904 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 14344 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 15052 core/libs/prx/libSceFreeTypeOt/CMakeLists.txt
PR 15136 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 15343 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16122 core/libs/prx/libSceFreeTypeOt/CMakeLists.txt
PR 16752 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16978 core/libs/prx/libSceFreeTypeOt/CMakeLists.txt
PR 17611 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17715 core/libs/prx/libSceFreeTypeOt/CMakeLists.txt
PR 17779 core/libs/prx/libSceFreeTypeOt/CMakeLists.txt
PR 17865 core/libs/prx/libSceFreeTypeOt/CMakeLists.txt
PR 18082 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

@adriadam10 adriadam10 self-assigned this Nov 10, 2026
@adriadam10
adriadam10 merged commit 3c65f5c into boykopovar:main Nov 11, 2026
21 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff against libSceFreeTypeOl's existing Apple link filter, the identical-type reasoning for Linux/Windows, green CI on the head and @JJenkx's Windows run; merged.

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.

3 participants