diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2017-09-17 18:22:33 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-09-19 09:22:55 -0400 |
commit | 644b66f83d5251cdf2a6d592e067595f60c90b71 (patch) | |
tree | 9e0507cc9ae6445ee7869778b850865c528b1920 | |
parent | 6aa755e493c298afc2ee49685180746ffd9cf7d7 (diff) | |
download | meta-virtualization-644b66f83d5251cdf2a6d592e067595f60c90b71.tar.gz |
xen: patch to fix ARM libxc missing variable init
Fix Xen 4.9.0 build error on ARM architecture with gcc 7:
Import upstream Xen patch 88bfbf90e35f1213f9967a97dee0b2039f9998a4
Error was:
xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | recipes-extended/xen/files/fix-libxc-xc_dom_arm-missing-initialization.patch | 36 | ||||
-rw-r--r-- | recipes-extended/xen/xen_4.9.0.bb | 2 |
2 files changed, 38 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/fix-libxc-xc_dom_arm-missing-initialization.patch b/recipes-extended/xen/files/fix-libxc-xc_dom_arm-missing-initialization.patch new file mode 100644 index 00000000..05016a7a --- /dev/null +++ b/recipes-extended/xen/files/fix-libxc-xc_dom_arm-missing-initialization.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | commit 88bfbf90e35f1213f9967a97dee0b2039f9998a4 | ||
2 | Author: Bernd Kuhls <bernd.kuhls@t-online.de> | ||
3 | Date: Sat Aug 19 16:21:42 2017 +0200 | ||
4 | |||
5 | tools/libxc/xc_dom_arm: add missing variable initialization | ||
6 | |||
7 | The variable domctl.u.address_size.size may remain uninitialized if | ||
8 | guest_type is not one of xen-3.0-aarch64 or xen-3.0-armv7l. And the | ||
9 | code precisely checks if this variable is still 0 to decide if the | ||
10 | guest type is supported or not. | ||
11 | |||
12 | This fixes the following build failure with gcc 7.x: | ||
13 | |||
14 | xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
15 | if ( domctl.u.address_size.size == 0 ) | ||
16 | |||
17 | Patch originally taken from | ||
18 | https://www.mail-archive.com/xen-devel@lists.xen.org/msg109313.html. | ||
19 | |||
20 | Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> | ||
21 | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
22 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
23 | |||
24 | diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c | ||
25 | index e7d4bd0..e669fb0 100644 | ||
26 | --- a/tools/libxc/xc_dom_arm.c | ||
27 | +++ b/tools/libxc/xc_dom_arm.c | ||
28 | @@ -223,6 +223,8 @@ static int set_mode(xc_interface *xch, domid_t domid, char *guest_type) | ||
29 | |||
30 | domctl.domain = domid; | ||
31 | domctl.cmd = XEN_DOMCTL_set_address_size; | ||
32 | + domctl.u.address_size.size = 0; | ||
33 | + | ||
34 | for ( i = 0; i < ARRAY_SIZE(types); i++ ) | ||
35 | if ( !strcmp(types[i].guest, guest_type) ) | ||
36 | domctl.u.address_size.size = types[i].size; | ||
diff --git a/recipes-extended/xen/xen_4.9.0.bb b/recipes-extended/xen/xen_4.9.0.bb index 0b209362..8e9c8024 100644 --- a/recipes-extended/xen/xen_4.9.0.bb +++ b/recipes-extended/xen/xen_4.9.0.bb | |||
@@ -1,7 +1,9 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
1 | require xen.inc | 2 | require xen.inc |
2 | 3 | ||
3 | SRC_URI = " \ | 4 | SRC_URI = " \ |
4 | https://downloads.xenproject.org/release/xen/${PV}/xen-${PV}.tar.gz \ | 5 | https://downloads.xenproject.org/release/xen/${PV}/xen-${PV}.tar.gz \ |
6 | file://fix-libxc-xc_dom_arm-missing-initialization.patch \ | ||
5 | " | 7 | " |
6 | 8 | ||
7 | SRC_URI[md5sum] = "f0a753637630f982dfbdb64121fd71e1" | 9 | SRC_URI[md5sum] = "f0a753637630f982dfbdb64121fd71e1" |