0002-memfd-fix-configure-test.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Mon Sep 17 00:00:00 2001
  2. From: Paolo Bonzini <pbonzini@redhat.com>
  3. Date: Tue, 28 Nov 2017 11:51:27 +0100
  4. Subject: [PATCH] memfd: fix configure test
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Recent glibc added memfd_create in sys/mman.h. This conflicts with
  9. the definition in util/memfd.c:
  10. /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration
  11. Fix the configure test, and remove the sys/memfd.h inclusion since the
  12. file actually does not exist---it is a typo in the memfd_create(2) man
  13. page.
  14. Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
  15. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  16. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  17. ---
  18. Upstream status: commit 75e5b70e6b5
  19. configure | 2 +-
  20. util/memfd.c | 4 +---
  21. 2 files changed, 2 insertions(+), 4 deletions(-)
  22. diff --git a/configure b/configure
  23. index 9c8aa5a98bd4..99ccc1725ace 100755
  24. --- a/configure
  25. +++ b/configure
  26. @@ -3923,7 +3923,7 @@ fi
  27. # check if memfd is supported
  28. memfd=no
  29. cat > $TMPC << EOF
  30. -#include <sys/memfd.h>
  31. +#include <sys/mman.h>
  32. int main(void)
  33. {
  34. diff --git a/util/memfd.c b/util/memfd.c
  35. index 4571d1aba866..412e94a405fc 100644
  36. --- a/util/memfd.c
  37. +++ b/util/memfd.c
  38. @@ -31,9 +31,7 @@
  39. #include "qemu/memfd.h"
  40. -#ifdef CONFIG_MEMFD
  41. -#include <sys/memfd.h>
  42. -#elif defined CONFIG_LINUX
  43. +#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
  44. #include <sys/syscall.h>
  45. #include <asm/unistd.h>
  46. --
  47. 2.16.2