[packages/xen] - added some ggc9 fixes
baggins
baggins at pld-linux.org
Sun Oct 27 13:03:43 CET 2019
commit 56bb081c5b0b96004e28051d093fc6236ac66b1f
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun Oct 27 13:02:23 2019 +0100
- added some ggc9 fixes
gcc9.patch | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
xen.spec | 4 +++-
2 files changed, 77 insertions(+), 1 deletion(-)
---
diff --git a/xen.spec b/xen.spec
index 449b028..5cd599e 100644
--- a/xen.spec
+++ b/xen.spec
@@ -41,7 +41,7 @@ Summary(pl.UTF-8): Xen - monitor maszyny wirtualnej
Name: xen
# NOTE: 4.9.0 being prepared on DEVEL branch
Version: 4.6.6
-Release: 1
+Release: 2
License: GPL v2, interface parts on BSD-like
Group: Applications/System
# for available versions see https://www.xenproject.org/developers/teams/hypervisor.html
@@ -105,6 +105,7 @@ Patch26: deprecated-readdir_r.patch
Patch27: ipxe-build.patch
Patch28: sysmacros.patch
Patch29: unused-function.patch
+Patch30: gcc9.patch
URL: http://www.xen.org/products/xenhyp.html
BuildRequires: autoconf >= 2.67
%ifarch %{ix86} %{x8664}
@@ -411,6 +412,7 @@ Nadzorca Xen w postaci, która może być uruchomiona wprost z firmware
%patch27 -p1
%patch28 -p1
%patch29 -p1
+%patch30 -p1
# stubdom sources
ln -s %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} stubdom
diff --git a/gcc9.patch b/gcc9.patch
new file mode 100644
index 0000000..92fae00
--- /dev/null
+++ b/gcc9.patch
@@ -0,0 +1,74 @@
+From 3fd3b266d4198c06e8e421ca515d9ba09ccd5155 Mon Sep 17 00:00:00 2001
+From: Jan Beulich <jbeulich at suse.com>
+Date: Mon, 13 May 2019 09:51:23 +0200
+Subject: [PATCH] trace: fix build with gcc9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While I've not observed this myself, gcc 9 (imo validly) reportedly may
+complain
+
+trace.c: In function '__trace_hypercall':
+trace.c:826:19: error: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Werror=address-of-packed-member]
+ 826 | uint32_t *a = d.args;
+
+and the fix is rather simple - remove the __packed attribute. Introduce
+a BUILD_BUG_ON() as replacement, for the unlikely case that Xen might
+get ported to an architecture where array alignment higher that that of
+its elements.
+
+Reported-by: Martin Liška <martin.liska at suse.com>
+Signed-off-by: Jan Beulich <jbeulich at suse.com>
+Acked-by: George Dunlap <george.dunlap at citrix.com>
+---
+ xen/common/trace.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/xen/common/trace.c b/xen/common/trace.c
+index cc294fc38473..d1ef81407b71 100644
+--- a/xen/common/trace.c
++++ b/xen/common/trace.c
+@@ -819,12 +819,18 @@ void __trace_var(u32 event, bool_t cycles, unsigned int extra,
+ void __trace_hypercall(uint32_t event, unsigned long op,
+ const xen_ulong_t *args)
+ {
+- struct __packed {
++ struct {
+ uint32_t op;
+ uint32_t args[6];
+ } d;
+ uint32_t *a = d.args;
+
++ /*
++ * In lieu of using __packed above, which gcc9 legitimately doesn't
++ * like in combination with the address of d.args[] taken.
++ */
++ BUILD_BUG_ON(offsetof(typeof(d), args) != sizeof(d.op));
++
+ #define APPEND_ARG32(i) \
+ do { \
+ unsigned i_ = (i); \
+--- xen-4.11.1/xen/drivers/passthrough/vtd/vtd.h.orig 2018-11-29 14:04:11.000000000 +0000
++++ xen-4.11.1/xen/drivers/passthrough/vtd/vtd.h 2019-02-05 21:32:50.056774501 +0000
+@@ -28,7 +28,7 @@
+ /* Allow for both IOAPIC and IOSAPIC. */
+ #define IO_xAPIC_route_entry IO_APIC_route_entry
+
+-struct IO_APIC_route_remap_entry {
++struct __packed IO_APIC_route_remap_entry {
+ union {
+ u64 val;
+ struct {
+--- xen-4.11.1/xen/arch/x86/cpu/mtrr/generic.c.orig 2018-11-29 14:04:11.000000000 +0000
++++ xen-4.11.1/xen/arch/x86/cpu/mtrr/generic.c 2019-02-10 19:24:09.378805103 +0000
+@@ -171,6 +171,9 @@
+ printk("%sMTRR variable ranges %sabled:\n", level,
+ mtrr_state.enabled ? "en" : "dis");
+ width = (paddr_bits - PAGE_SHIFT + 3) / 4;
++ if ( width > 64 ) {
++ width=64;
++ }
+
+ for (i = 0; i < num_var_ranges; ++i) {
+ if (mtrr_state.var_ranges[i].mask & MTRR_PHYSMASK_VALID)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xen.git/commitdiff/56bb081c5b0b96004e28051d093fc6236ac66b1f
More information about the pld-cvs-commit
mailing list