diff --git a/configure.ac b/configure.ac index 036dfb925bf..a02173f2442 100644 --- a/configure.ac +++ b/configure.ac @@ -793,6 +793,7 @@ AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"]) AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"]) AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"]) AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"]) +AC_CHECK_FUNC([memfd_create], [DEFINES="$DEFINES -DHAVE_MEMFD_CREATE"]) AC_MSG_CHECKING([whether strtod has locale support]) AC_LINK_IFELSE([AC_LANG_SOURCE([[ diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 27eedb53aa7..4b246958b75 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -131,11 +131,13 @@ futex_wait(uint32_t *addr, int32_t value) return sys_futex(addr, FUTEX_WAIT, value, NULL, NULL, 0); } +#ifndef HAVE_MEMFD_CREATE static inline int memfd_create(const char *name, unsigned int flags) { return syscall(SYS_memfd_create, name, flags); } +#endif static inline uint32_t ilog2_round_up(uint32_t value) diff --git a/src/intel/vulkan/anv_gem_stubs.c b/src/intel/vulkan/anv_gem_stubs.c index 02527b5fcd8..26eb5c8a610 100644 --- a/src/intel/vulkan/anv_gem_stubs.c +++ b/src/intel/vulkan/anv_gem_stubs.c @@ -27,11 +27,13 @@ #include "anv_private.h" +#ifndef HAVE_MEMFD_CREATE static inline int memfd_create(const char *name, unsigned int flags) { return syscall(SYS_memfd_create, name, flags); } +#endif uint32_t anv_gem_create(struct anv_device *device, uint64_t size)