build(libSceAgcDriver): compile the tests on macOS #15700
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15700"
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 javierUDP on 2026-11-04T07:32:10Z.
What
Four libSceAgcDriver tests guarded Linux-only code with
#ifndef _WIN32, so a macOS build compiled it and failed:HostImportSparseDmaBuf.cppandexecution/SparseDmaBufImport.cpp:memfd_createsealing (MFD_ALLOW_SEALING,F_ADD_SEALS,F_SEAL_SHRINK).SharedWrites.cpp:RUSAGE_THREAD, and/proc/self/mapsat run time.GcnColorTarget.cpp:MAP_FIXED_NOREPLACE.The two udmabuf tests already had a branch that prints "skipped, udmabuf imports are Linux only" and skips. Its condition is now
!__linux__instead of_WIN32.SharedWrites.cppguards with__linux__the fault count of its benchmark (printed, never checked), the/proc/self/mapsleak check, and the two blocks that write through the shared backing writer.DirectMemory.cppregisters that writer only under__linux__, so on macOSGuestArenaWriteSharedBackingreturns false: the first block failed with "shared writer rejected direct backing", and the second would have passed without checking anything. #7631 brings direct memory to macOS and can widen that guard. With these guards the rest of the test runs on macOS for the first time, and passes.GcnColorTarget.cpptakes its memory below 1 TiB from the guest arena on macOS, as it does on Windows. The arena takes the Windows protection value on every host, so the macOS branch passesReadWriteProtection = 0x04, the nameGuestHeap.cppuses.Windows and Linux compile the same code as before.
Tested
macOS 27.2 (Apple M5), x86-64 under Rosetta, Release, AppleClang.
maindoes not build on macOS by itself, so this ran with #11049, #11119, #7804 and #4630 merged in: onmainb8efa6292a, and the tests again on5b1d381d5aafter the rebase, where none of these files had changed. The macOS CI builds only the relinker and a few narrow targets, which is how these got in.main, none with this change.agc_gcn_color_target,agc_shared_writeandagc_shared_write_partial_collectpass.agc_host_import_sparseandagc_driver_sparse_dma_buf_importskip with "udmabuf imports are Linux only".Linux and Windows not built here.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)