fix(libs): build with libc++ #4629
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4629"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by mugurc on 2026-10-12T17:03:10Z.
What
Where Apple clang's libc++ differs from the libstdc++ the sources relied on. Part of the macOS series announced on #1 (https://github.com/boykopovar/AnyPS5/issues/1#issuecomment-6124344298).
std::atomic<std::shared_ptr<T>>is not provided by libc++.AtomicSharedPtr<T>is that type where the library defines__cpp_lib_atomic_shared_ptr(libstdc++ 12 and later, so the Linux and Windows builds) and a mutex-guarded pointer with the same member functions elsewhere. The AGC driver uses it in place of the atomic.std::atomic_ref<const T>is not provided; the page span reads go through a non-const reference.std::filesystem::file_time_type::clock::to_sysis not provided by libc++;std::chrono::file_clock::to_sysis.std::maxandstd::mindo not deduce whenuintptr_tanduint64_tdiffer, as they do on macOS; the guest range arithmetic names the type.<string>and<initializer_list>are included where the sources and tests use them.Tested
main,ninja,ninja libsandctest -j4on macOS ran 940 tests in the last full run (main2a5eca11c): 582 passed, 357 were skipped (no Vulkan loader in the environment, no guest address-space arena on macOS) and 1 failed. The failure isguest_socket_read_write, an existing test this series does not touch: after the peer has closed, the write that it expects to fail withEPIPEfails withECONNRESETorEAGAINon macOS, in 8 of 60 runs of the test alone.ShaderUtils.cpp, the SaveData export and the five tests compile on macOS. The AGC driver sources need the other pull requests of the series to compile on macOS (generated shader headers,linux/udmabuf.h,pthread_getattr_np); the lines this one changes in them compile in that context.main33ae282e4), run on my fork: 960 tests on Linux and 966 on Windows pass (https://github.com/mugurc/AnyPS5/actions/runs/38256280627).AtomicSharedPtr<T>isstd::atomic<std::shared_ptr<T>>there, so the types are unchanged.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T17:51:40Z.
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.
main)core/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppcore/libs/prx/libc/include/general/AtomicSharedPtr.hppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-14T21:07:31Z.
Review: COMMENTED
Checked on Apple M2 Max, macOS 27.2, Xcode 27.0 (Apple clang 21.0.0,
-fexperimental-library), x86-64 full build under Rosetta. Headfacc03ae9onmain41cc655b8, with #4627 applied. The merge is clean.GuestDup,GuestPthreadMutexattrandGuestSchedPrioritycompile with this PR. Onmainthey fail onstd::initializer_list.-fsyntax-onlyand the ninja command line:libSceAgc/Shader/src/ShaderUtils.cpp: fails onmain(incompletestd::basic_string), compiles with the PR.Execution/src/GuestMemory.cpp: onmain, twoatomic_referrors plus the twopthread_getattr_nperrors. With the PR only thepthread_getattr_npones remain, as the description says.GuestBufferMemory.cpp(linux/udmabuf.h) andRecorder.cpp(generated_spv.h) still stop on what the description lists for the other PRs.libSceSaveData.native/Export.cppalready compiles onmainwith this toolchain: Xcode 27's libc++ providesfile_time_type::clock::to_sys. Thefile_clock::to_syschange is harmless here; it matters for older libc++.Written with AI assistance (Claude Code). I ran the builds above on my machine.