]> git.pld-linux.org Git - packages/qemu.git/blob - qemu-glibc2_27.patch
upstream patch to fix build with glibc 2.27
[packages/qemu.git] / qemu-glibc2_27.patch
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=utf8
7 Content-Transfer-Encoding: 8bit
8
9 Recent glibc added memfd_create in sys/mman.h.  This conflicts with
10 the definition in util/memfd.c:
11
12     /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration
13
14 Fix the configure test, and remove the sys/memfd.h inclusion since the
15 file actually does not exist---it is a typo in the memfd_create(2) man
16 page.
17
18 Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
19 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
20 ---
21  configure    | 2 +-
22  util/memfd.c | 4 +---
23  2 files changed, 2 insertions(+), 4 deletions(-)
24
25 diff --git a/configure b/configure
26 index 9c8aa5a..99ccc17 100755
27 --- a/configure
28 +++ b/configure
29 @@ -3923,7 +3923,7 @@ fi
30  # check if memfd is supported
31  memfd=no
32  cat > $TMPC << EOF
33 -#include <sys/memfd.h>
34 +#include <sys/mman.h>
35  
36  int main(void)
37  {
38 diff --git a/util/memfd.c b/util/memfd.c
39 index 4571d1a..412e94a 100644
40 --- a/util/memfd.c
41 +++ b/util/memfd.c
42 @@ -31,9 +31,7 @@
43  
44  #include "qemu/memfd.h"
45  
46 -#ifdef CONFIG_MEMFD
47 -#include <sys/memfd.h>
48 -#elif defined CONFIG_LINUX
49 +#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
50  #include <sys/syscall.h>
51  #include <asm/unistd.h>
52  
53 -- 
54 1.8.3.1
55
This page took 0.029428 seconds and 3 git commands to generate.