fix(agc): build the dma-buf run list import and its test on macOS #15002

Merged
imellag merged 2 commits from upstream-pr/15002 into main 2026-11-03 05:13:01 +00:00
imellag commented 2026-11-02 09:23:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-11-02T09:23:36Z.


What

main stops compiling libSceAgcDriver on macOS at two places added by the dma-buf run list import (e00eaac2ff and its test):

  • GuestBufferMemory.cpp: the __APPLE__ stand-ins for <linux/udmabuf.h> declare udmabuf_create, UDMABUF_FLAGS_CLOEXEC and UDMABUF_CREATE, but not udmabuf_create_item, udmabuf_create_list and UDMABUF_CREATE_LIST, which createDmaBufImport now uses. They are added with the Linux layout. udmabufDevice() returns -1 on macOS, so neither ioctl is ever issued there.
  • tests/execution/ScatteredRuns.cpp drives UDMABUF_CREATE_LIST through memfd_create and file seals, which only Linux has. It already skipped on Windows (skipped, udmabuf imports are Linux only); it now skips on every host that isn't Linux, instead of compiling the Linux body on macOS and stopping at MFD_CLOEXEC.

Tested

macOS 27.2, Apple M4 Pro, Apple clang 21, x86-64 Release (Rosetta 2). main doesn't build the libraries on macOS by itself, so the tree is main 88e804b0a7 + the open macOS PRs #11554, #7631, #7804, #4630 and #14883 (FreeTypeOl NID patching), plus this branch:

  • without this branch the build stops at GuestBufferMemory.cpp:694 (unknown type name 'udmabuf_create_list') and, once that is fixed, at ScatteredRuns.cpp:141 (use of undeclared identifier 'MFD_CLOEXEC');
  • with it, the full cmake --build and --target libs pass;
  • ctest -R scatter: agc_driver_scattered_runs is reported as skipped.

Linux and Windows compile the same code as before: the Linux path still includes <linux/udmabuf.h>, and the test's __linux__ branch is the body the previous #ifndef _WIN32 selected there. Not run on them.

tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py finds no conflicting lines. Several open PRs that conflict with main also edit GuestBufferMemory.cpp; none of them touches the udmabuf declarations or ScatteredRuns.cpp.

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 (build fix; no GPU test changed or run)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5117933965 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15002). Originally posted by [imellag](https://github.com/imellag) on 2026-11-02T09:23:36Z. --- ### What `main` stops compiling `libSceAgcDriver` on macOS at two places added by the dma-buf run list import (e00eaac2ff4 and its test): - `GuestBufferMemory.cpp`: the `__APPLE__` stand-ins for `<linux/udmabuf.h>` declare `udmabuf_create`, `UDMABUF_FLAGS_CLOEXEC` and `UDMABUF_CREATE`, but not `udmabuf_create_item`, `udmabuf_create_list` and `UDMABUF_CREATE_LIST`, which `createDmaBufImport` now uses. They are added with the Linux layout. `udmabufDevice()` returns -1 on macOS, so neither ioctl is ever issued there. - `tests/execution/ScatteredRuns.cpp` drives `UDMABUF_CREATE_LIST` through `memfd_create` and file seals, which only Linux has. It already skipped on Windows (`skipped, udmabuf imports are Linux only`); it now skips on every host that isn't Linux, instead of compiling the Linux body on macOS and stopping at `MFD_CLOEXEC`. ### Tested macOS 27.2, Apple M4 Pro, Apple clang 21, x86-64 Release (Rosetta 2). `main` doesn't build the libraries on macOS by itself, so the tree is `main` `88e804b0a7` + the open macOS PRs #11554, #7631, #7804, #4630 and #14883 (FreeTypeOl NID patching), plus this branch: - without this branch the build stops at `GuestBufferMemory.cpp:694` (`unknown type name 'udmabuf_create_list'`) and, once that is fixed, at `ScatteredRuns.cpp:141` (`use of undeclared identifier 'MFD_CLOEXEC'`); - with it, the full `cmake --build` and `--target libs` pass; - `ctest -R scatter`: `agc_driver_scattered_runs` is reported as skipped. Linux and Windows compile the same code as before: the Linux path still includes `<linux/udmabuf.h>`, and the test's `__linux__` branch is the body the previous `#ifndef _WIN32` selected there. Not run on them. `tools/check_conventions.py --base upstream/main` passes. `tools/pr_overlap.py` finds no conflicting lines. Several open PRs that conflict with `main` also edit `GuestBufferMemory.cpp`; none of them touches the udmabuf declarations or `ScatteredRuns.cpp`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 (build fix; no GPU test changed or run) - [x] AI-assisted: yes
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!15002
No description provided.