diff mbox

[1/3] kvmtool: add patch to fix build with musl

Message ID 20170819205528.31753-1-thomas.petazzoni@free-electrons.com
State Accepted
Headers show

Commit Message

Thomas Petazzoni Aug. 19, 2017, 8:55 p.m. UTC
This commit backports an upstream patch that fixes the build of
kvmtool with musl:

In file included from builtin-balloon.c:9:0:
include/kvm/kvm.h:22:0: warning: "PAGE_SIZE" redefined
 #define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))

Fixes one part of:

  http://autobuild.buildroot.net/results/4459a909e735343d1cf768d30466bc3c57eca19e/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../kvmtool/0001-avoid-redefining-PAGE_SIZE.patch  | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/kvmtool/0001-avoid-redefining-PAGE_SIZE.patch

Comments

Bernd Kuhls Aug. 20, 2017, 8:06 a.m. UTC | #1
Am Sat, 19 Aug 2017 22:55:26 +0200 schrieb Thomas Petazzoni:

> This commit backports an upstream patch that fixes the build of kvmtool
> with musl:
> 
> In file included from builtin-balloon.c:9:0:
> include/kvm/kvm.h:22:0: warning: "PAGE_SIZE" redefined
>  #define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
> 
> Fixes one part of:
> 
>   http://autobuild.buildroot.net/
results/4459a909e735343d1cf768d30466bc3c57eca19e/

Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[ build-tested using http://autobuild.buildroot.net/results/ae4/
ae434d85be12d07dddf4c955855120da83a19dd6/defconfig ]
Thomas Petazzoni Aug. 21, 2017, 9:25 p.m. UTC | #2
Hello,

On Sat, 19 Aug 2017 22:55:26 +0200, Thomas Petazzoni wrote:
> This commit backports an upstream patch that fixes the build of
> kvmtool with musl:
> 
> In file included from builtin-balloon.c:9:0:
> include/kvm/kvm.h:22:0: warning: "PAGE_SIZE" redefined
>  #define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
> 
> Fixes one part of:
> 
>   http://autobuild.buildroot.net/results/4459a909e735343d1cf768d30466bc3c57eca19e/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  .../kvmtool/0001-avoid-redefining-PAGE_SIZE.patch  | 42 ++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 package/kvmtool/0001-avoid-redefining-PAGE_SIZE.patch

All applied. Thanks Bernd for having tested the patches!

Thomas
diff mbox

Patch

diff --git a/package/kvmtool/0001-avoid-redefining-PAGE_SIZE.patch b/package/kvmtool/0001-avoid-redefining-PAGE_SIZE.patch
new file mode 100644
index 0000000..ed3370c
--- /dev/null
+++ b/package/kvmtool/0001-avoid-redefining-PAGE_SIZE.patch
@@ -0,0 +1,42 @@ 
+From bec1b0ced72dc0d49825d6b69d09296d13fd0af3 Mon Sep 17 00:00:00 2001
+From: Andre Przywara <andre.przywara@arm.com>
+Date: Tue, 21 Jul 2015 10:58:46 +0100
+Subject: [PATCH] avoid redefining PAGE_SIZE
+
+PAGE_SIZE may have been defined by the C libary (musl-libc does that).
+So avoid redefining it here unconditionally, instead only use our
+definition if none has been provided by the libc.
+
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+[backport from upstream commit 4095fac878f618ae5e7384a1dc65ee34b6e05217.]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ include/kvm/kvm.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h
+index 754e029..37155db 100644
+--- a/include/kvm/kvm.h
++++ b/include/kvm/kvm.h
+@@ -11,6 +11,7 @@
+ #include <time.h>
+ #include <signal.h>
+ #include <sys/prctl.h>
++#include <limits.h>
+ 
+ #define SIGKVMEXIT		(SIGRTMIN + 0)
+ #define SIGKVMPAUSE		(SIGRTMIN + 1)
+@@ -19,7 +20,9 @@
+ #define HOME_DIR		getenv("HOME")
+ #define KVM_BINARY_NAME		"lkvm"
+ 
++#ifndef PAGE_SIZE
+ #define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
++#endif
+ 
+ #define DEFINE_KVM_EXT(ext)		\
+ 	.name = #ext,			\
+-- 
+2.9.4
+