-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stage1/kvm: fix qemu memfd build failure
This is a backport of a qemu upstream patch to fix a memfd related failure. It first adds infrastructure to apply the patch to qemu at build time. Ref: https://git.qemu.org/?p=qemu.git;a=commit;h=75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Ref: rkt#3921 (comment)
- Loading branch information
Showing
2 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
stage1/usr_from_kvm/qemu/patches/000-memfd_fix_configure_test.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Mon Sep 17 00:00:00 2001 | ||
From: Paolo Bonzini <[email protected]> | ||
Date: Tue, 28 Nov 2017 11:51:27 +0100 | ||
Subject: [PATCH] memfd: fix configure test | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=utf8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Recent glibc added memfd_create in sys/mman.h. This conflicts with | ||
the definition in util/memfd.c: | ||
|
||
/builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration | ||
|
||
Fix the configure test, and remove the sys/memfd.h inclusion since the | ||
file actually does not exist---it is a typo in the memfd_create(2) man | ||
page. | ||
|
||
Cc: Marc-André Lureau <[email protected]> | ||
Signed-off-by: Paolo Bonzini <[email protected]> | ||
--- | ||
configure | 2 +- | ||
util/memfd.c | 4 +--- | ||
2 files changed, 2 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/configure b/configure | ||
index 9c8aa5a..99ccc17 100755 | ||
--- a/configure | ||
+++ b/configure | ||
@@ -3923,7 +3923,7 @@ fi | ||
# check if memfd is supported | ||
memfd=no | ||
cat > $TMPC << EOF | ||
-#include <sys/memfd.h> | ||
+#include <sys/mman.h> | ||
|
||
int main(void) | ||
{ | ||
diff --git a/util/memfd.c b/util/memfd.c | ||
index 4571d1a..412e94a 100644 | ||
--- a/util/memfd.c | ||
+++ b/util/memfd.c | ||
@@ -31,9 +31,7 @@ | ||
|
||
#include "qemu/memfd.h" | ||
|
||
-#ifdef CONFIG_MEMFD | ||
-#include <sys/memfd.h> | ||
-#elif defined CONFIG_LINUX | ||
+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD | ||
#include <sys/syscall.h> | ||
#include <asm/unistd.h> | ||
|
||
-- | ||
1.8.3.1 | ||
|