From b5cd872288a17b1af0220575faaa926be50c8ebb Mon Sep 17 00:00:00 2001 From: Jun Sun Date: Wed, 8 Apr 2026 03:40:51 +0000 Subject: [PATCH] gfxstream: include sys/syscall.h for memfd_create on riscv64 SharedMemory_posix.cpp has hardcoded __NR_memfd_create syscall numbers for x86/arm but not riscv64. Including sys/syscall.h provides the correct kernel-defined value, so the hardcoded fallback is skipped. --- .../build_external/gfxstream/gfxstream.MODULE.bazel | 1 + .../gfxstream/riscv64_memfd_create.patch | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 base/cvd/build_external/gfxstream/riscv64_memfd_create.patch diff --git a/base/cvd/build_external/gfxstream/gfxstream.MODULE.bazel b/base/cvd/build_external/gfxstream/gfxstream.MODULE.bazel index 43bcc09d0e7..89bc85f3c32 100644 --- a/base/cvd/build_external/gfxstream/gfxstream.MODULE.bazel +++ b/base/cvd/build_external/gfxstream/gfxstream.MODULE.bazel @@ -8,5 +8,6 @@ git_repository( patches = [ "@//build_external/gfxstream:PATCH.gfxstream.build_variables.patch", "@//build_external/gfxstream:bazel9.patch", + "@//build_external/gfxstream:riscv64_memfd_create.patch", ], ) diff --git a/base/cvd/build_external/gfxstream/riscv64_memfd_create.patch b/base/cvd/build_external/gfxstream/riscv64_memfd_create.patch new file mode 100644 index 00000000000..389887d1601 --- /dev/null +++ b/base/cvd/build_external/gfxstream/riscv64_memfd_create.patch @@ -0,0 +1,10 @@ +--- a/common/base/SharedMemory_posix.cpp ++++ b/common/base/SharedMemory_posix.cpp +@@ -16,6 +16,7 @@ + #include + #include + ++#include + #include "gfxstream/EintrWrapper.h" + #include "gfxstream/Macros.h" + #include "gfxstream/files/PathUtils.h"