From 97017bddb220f7c6d62b26a042a5aa9f9d0fdce2 Mon Sep 17 00:00:00 2001 From: Marcus Figueiredo Date: Mon, 22 Jun 2026 23:15:31 -0300 Subject: [PATCH 1/4] common: fix macOS shared memory names Signed-off-by: Marcus Figueiredo --- common/base/SharedMemory_posix.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/base/SharedMemory_posix.cpp b/common/base/SharedMemory_posix.cpp index 638751a07..05c901398 100644 --- a/common/base/SharedMemory_posix.cpp +++ b/common/base/SharedMemory_posix.cpp @@ -55,7 +55,11 @@ SharedMemory::SharedMemory(const std::string& name, size_t size) { mName = PathUtils::recompose(PathUtils::decompose(std::move(path))); } else { mShareType = ShareType::SHARED_MEMORY; +#ifdef __APPLE__ + mName = (!name.empty() && name[0] != '/') ? ("/" + name) : name; +#else mName = name; +#endif } } @@ -111,7 +115,9 @@ int SharedMemory::openInternal(int oflag, int mode, bool doMapping) { int err = 0; struct stat sb; if (mShareType == ShareType::SHARED_MEMORY) { -#if defined(HAVE_MEMFD_CREATE) +#if defined(__APPLE__) + mFd = ::shm_open(mName.c_str(), oflag, mode); +#elif defined(HAVE_MEMFD_CREATE) mFd = memfd_create(mName.c_str(), MFD_CLOEXEC | MFD_ALLOW_SEALING); #else mFd = syscall(__NR_memfd_create, mName.c_str(), FD_CLOEXEC); From 273e368b13f12ced85022a50040be8fde03f5a05 Mon Sep 17 00:00:00 2001 From: Marcus Figueiredo Date: Mon, 22 Jun 2026 23:15:31 -0300 Subject: [PATCH 2/4] host: propagate createBlob failures Signed-off-by: Marcus Figueiredo --- host/virtio_gpu_gfxstream_renderer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/host/virtio_gpu_gfxstream_renderer.cpp b/host/virtio_gpu_gfxstream_renderer.cpp index b6dac07bf..3c587865f 100644 --- a/host/virtio_gpu_gfxstream_renderer.cpp +++ b/host/virtio_gpu_gfxstream_renderer.cpp @@ -450,8 +450,7 @@ VG_EXPORT int stream_renderer_create_blob(uint32_t ctx_id, uint32_t res_handle, GFXSTREAM_TRACE_EVENT(GFXSTREAM_TRACE_STREAM_RENDERER_CATEGORY, "stream_renderer_create_blob()"); - sFrontend()->createBlob(ctx_id, res_handle, create_blob, handle); - return 0; + return sFrontend()->createBlob(ctx_id, res_handle, create_blob, handle); } VG_EXPORT int stream_renderer_export_blob(uint32_t res_handle, From 451181f0884b8d2ce31a77d575ea372bb526eb61 Mon Sep 17 00:00:00 2001 From: Jovemexausto Date: Wed, 24 Jun 2026 12:04:40 -0300 Subject: [PATCH 3/4] ci: add macOS host build job --- .github/workflows/build-macos.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/build-macos.yaml diff --git a/.github/workflows/build-macos.yaml b/.github/workflows/build-macos.yaml new file mode 100644 index 000000000..01d6b551a --- /dev/null +++ b/.github/workflows/build-macos.yaml @@ -0,0 +1,17 @@ +name: Gfxstream macOS Build + +on: + pull_request: + push: + branches-ignore: + - main + +jobs: + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - run: brew install meson ninja molten-vk vulkan-loader + - run: | + meson setup -Ddefault_library=static -Dgfxstream-build=host build + meson compile -C build From be7de40e0407f0227852078405fb22cc3ac8f9ce Mon Sep 17 00:00:00 2001 From: Jovemexausto Date: Wed, 24 Jun 2026 12:04:46 -0300 Subject: [PATCH 4/4] common: make shm_open names POSIX-compliant --- common/base/SharedMemory_posix.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/base/SharedMemory_posix.cpp b/common/base/SharedMemory_posix.cpp index 05c901398..efd971c4a 100644 --- a/common/base/SharedMemory_posix.cpp +++ b/common/base/SharedMemory_posix.cpp @@ -55,11 +55,10 @@ SharedMemory::SharedMemory(const std::string& name, size_t size) { mName = PathUtils::recompose(PathUtils::decompose(std::move(path))); } else { mShareType = ShareType::SHARED_MEMORY; -#ifdef __APPLE__ + // POSIX.1-2017 (System Interfaces) requires shm_open() names to begin + // with a '/' character to avoid implementation-defined behavior. + // Normalize unconditionally so callers don't need to care about it. mName = (!name.empty() && name[0] != '/') ? ("/" + name) : name; -#else - mName = name; -#endif } }