SHA256
1
0
forked from pool/qemu

Accepting request 706380 from home:bfrogers:branches:Virtualization

Fix some gcc9 compatibility issues.

OBS-URL: https://build.opensuse.org/request/show/706380
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=474
This commit is contained in:
Bruce Rogers 2019-05-29 17:48:52 +00:00 committed by Git OBS Bridge
parent 4e4aa3a7aa
commit 24d3c9d352
11 changed files with 172 additions and 0 deletions

View File

@ -0,0 +1,24 @@
From: Bruce Rogers <brogers@suse.com>
Date: Tue, 28 May 2019 13:35:39 -0600
Subject: target/ppc: ensure we get null terminated rtas token name
Leave room for null termination of the string when doing strncpy.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
target/ppc/kvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 2427c8ee13..7885de2d7c 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2605,7 +2605,7 @@ int kvmppc_define_rtas_kernel_token(uint32_t token, const char *function)
return -ENOENT;
}
- strncpy(args.name, function, sizeof(args.name));
+ strncpy(args.name, function, sizeof(args.name) - 1);
return kvm_vm_ioctl(kvm_state, KVM_PPC_RTAS_DEFINE_TOKEN, &args);
}

View File

@ -0,0 +1,33 @@
From: Bruce Rogers <brogers@suse.com>
Date: Tue, 28 May 2019 14:23:37 -0600
Subject: configure: only populate roms if softmmu
Currently roms are mistakenly getting built in a linux-user only
configuration. Add check for softmmu in all places where our list of
roms is being added to.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
configure | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 5df1b9a285..cf261e9cc5 100755
--- a/configure
+++ b/configure
@@ -6166,12 +6166,13 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
fi
done
fi
-if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" ; then
+if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" && \
+ test "$softmmu" = yes ; then
roms="$roms spapr-rtas"
fi
# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
-if test "$cpu" = "s390x" ; then
+if test "$cpu" = "s390x" && test "$softmmu" = yes ; then
write_c_skeleton
if compile_prog "-march=z900" ""; then
roms="$roms s390-ccw"

View File

@ -0,0 +1,24 @@
From: Bruce Rogers <brogers@suse.com>
Date: Wed, 29 May 2019 09:59:02 -0600
Subject: pc-bios/s390-ccw/net: avoid warning about packed structure members
This is hopefully temporary. Simply disable the warning about taking
the address of packed structure members which is new in gcc9.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
pc-bios/s390-ccw/netboot.mak | 1 +
1 file changed, 1 insertion(+)
diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak
index 14e96b2aa6..c965a4cfd4 100644
--- a/pc-bios/s390-ccw/netboot.mak
+++ b/pc-bios/s390-ccw/netboot.mak
@@ -53,6 +53,7 @@ libc.a: $(LIBCOBJS)
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
LIBNETCFLAGS := $(QEMU_CFLAGS) $(CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC)
+LIBNETCFLAGS += -Wno-address-of-packed-member
%.o : $(SLOF_DIR)/lib/libnet/%.c
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed May 29 16:03:58 UTC 2019 - Bruce Rogers <brogers@suse.com>
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
* Patches added:
0048-pc-bios-s390-ccw-net-avoid-warning-.patch
0046-target-ppc-ensure-we-get-null-termi.patch
0047-configure-only-populate-roms-if-sof.patch
-------------------------------------------------------------------
Fri May 17 19:05:11 UTC 2019 - Bruce Rogers <brogers@suse.com>

View File

@ -79,6 +79,9 @@ Patch0042: 0042-libvhost-user-fix-Waddress-of-packe.patch
Patch0043: 0043-target-i386-define-md-clear-bit.patch
Patch0044: 0044-hw-intc-exynos4210_gic-provide-more.patch
Patch0045: 0045-kbd-state-fix-autorepeat-handling.patch
Patch0046: 0046-target-ppc-ensure-we-get-null-termi.patch
Patch0047: 0047-configure-only-populate-roms-if-sof.patch
Patch0048: 0048-pc-bios-s390-ccw-net-avoid-warning-.patch
# Please do not add QEMU patches manually here.
# Run update_git.sh to regenerate this queue.
ExcludeArch: s390
@ -154,6 +157,9 @@ syscall layer occurs on the native hardware and operating system.
%patch0043 -p1
%patch0044 -p1
%patch0045 -p1
%patch0046 -p1
%patch0047 -p1
%patch0048 -p1
%build
%define _lto_cflags %{nil}

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Wed May 29 16:03:57 UTC 2019 - Bruce Rogers <brogers@suse.com>
- Fix a number of compatibility issues with the stricter gcc9 checks
* Disable warning for taking address of packed structure members
0048-pc-bios-s390-ccw-net-avoid-warning-.patch
* Fix case of strncpy where null terminated string not guaranteed
0046-target-ppc-ensure-we-get-null-termi.patch
* Disable warning for taking address of packed structure members
and fix case of passing null pointer as "%s" format parameter
skiboot-gcc9-compat.patch
- Fix configure script which caused firmware to be built in
linux-user only build.
0047-configure-only-populate-roms-if-sof.patch
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
-------------------------------------------------------------------
Fri May 17 19:05:10 UTC 2019 - Bruce Rogers <brogers@suse.com>

View File

@ -189,6 +189,9 @@ Patch0042: 0042-libvhost-user-fix-Waddress-of-packe.patch
Patch0043: 0043-target-i386-define-md-clear-bit.patch
Patch0044: 0044-hw-intc-exynos4210_gic-provide-more.patch
Patch0045: 0045-kbd-state-fix-autorepeat-handling.patch
Patch0046: 0046-target-ppc-ensure-we-get-null-termi.patch
Patch0047: 0047-configure-only-populate-roms-if-sof.patch
Patch0048: 0048-pc-bios-s390-ccw-net-avoid-warning-.patch
# Please do not add QEMU patches manually here.
# Run update_git.sh to regenerate this queue.
@ -211,6 +214,7 @@ Patch1301: sgabios-fix-cross-build.patch
# SLOF - path: roms/SLOF (patch range 1400-1499) (Currently no patches)
# skiboot - path: roms/skiboot (patch range 1500-1599) (Currently no patches)
Patch1500: skiboot-gcc9-compat.patch
# keycodemapdb - path: ui/keycodemapdb (patch range 1600-1699) (Currently no patches)
@ -1001,6 +1005,9 @@ This package provides a service file for starting and stopping KSM.
%patch0043 -p1
%patch0044 -p1
%patch0045 -p1
%patch0046 -p1
%patch0047 -p1
%patch0048 -p1
pushd roms/seabios
%patch1100 -p1
@ -1031,6 +1038,7 @@ pushd roms/SLOF
popd
pushd roms/skiboot
%patch1500 -p1
popd
pushd ui/keycodemapdb

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Wed May 29 16:03:57 UTC 2019 - Bruce Rogers <brogers@suse.com>
- Fix a number of compatibility issues with the stricter gcc9 checks
* Disable warning for taking address of packed structure members
0048-pc-bios-s390-ccw-net-avoid-warning-.patch
* Fix case of strncpy where null terminated string not guaranteed
0046-target-ppc-ensure-we-get-null-termi.patch
* Disable warning for taking address of packed structure members
and fix case of passing null pointer as "%s" format parameter
skiboot-gcc9-compat.patch
- Fix configure script which caused firmware to be built in
linux-user only build.
0047-configure-only-populate-roms-if-sof.patch
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
-------------------------------------------------------------------
Fri May 17 19:05:10 UTC 2019 - Bruce Rogers <brogers@suse.com>

View File

@ -189,6 +189,9 @@ Patch0042: 0042-libvhost-user-fix-Waddress-of-packe.patch
Patch0043: 0043-target-i386-define-md-clear-bit.patch
Patch0044: 0044-hw-intc-exynos4210_gic-provide-more.patch
Patch0045: 0045-kbd-state-fix-autorepeat-handling.patch
Patch0046: 0046-target-ppc-ensure-we-get-null-termi.patch
Patch0047: 0047-configure-only-populate-roms-if-sof.patch
Patch0048: 0048-pc-bios-s390-ccw-net-avoid-warning-.patch
# Please do not add QEMU patches manually here.
# Run update_git.sh to regenerate this queue.
@ -211,6 +214,7 @@ Patch1301: sgabios-fix-cross-build.patch
# SLOF - path: roms/SLOF (patch range 1400-1499) (Currently no patches)
# skiboot - path: roms/skiboot (patch range 1500-1599) (Currently no patches)
Patch1500: skiboot-gcc9-compat.patch
# keycodemapdb - path: ui/keycodemapdb (patch range 1600-1699) (Currently no patches)
@ -1001,6 +1005,9 @@ This package provides a service file for starting and stopping KSM.
%patch0043 -p1
%patch0044 -p1
%patch0045 -p1
%patch0046 -p1
%patch0047 -p1
%patch0048 -p1
pushd roms/seabios
%patch1100 -p1
@ -1031,6 +1038,7 @@ pushd roms/SLOF
popd
pushd roms/skiboot
%patch1500 -p1
popd
pushd ui/keycodemapdb

View File

@ -164,6 +164,7 @@ Patch1301: sgabios-fix-cross-build.patch
# SLOF - path: roms/SLOF (patch range 1400-1499) (Currently no patches)
# skiboot - path: roms/skiboot (patch range 1500-1599) (Currently no patches)
Patch1500: skiboot-gcc9-compat.patch
# keycodemapdb - path: ui/keycodemapdb (patch range 1600-1699) (Currently no patches)
@ -940,6 +941,7 @@ pushd roms/SLOF
popd
pushd roms/skiboot
%patch1500 -p1
popd
pushd ui/keycodemapdb

26
skiboot-gcc9-compat.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/Makefile.main b/Makefile.main
index 19378789..bbfc552a 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -75,6 +75,7 @@ CPPFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
endif
CFLAGS := -fno-strict-aliasing -pie -fpie -fno-pic -mbig-endian -m64
+CFLAGS += -Wno-address-of-packed-member
CFLAGS += -mcpu=power7
CFLAGS += -Wl,--oformat,elf64-powerpc
CFLAGS += $(call try-cflag,$(CC),-ffixed-r13)
diff --git a/hdata/vpd.c b/hdata/vpd.c
index 129b5062..ce17c1dc 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -388,8 +388,7 @@ static void vpd_vini_parse(struct dt_node *node,
} else {
dt_add_property_string(node, "description", "Unknown");
prlog(PR_WARNING,
- "VPD: CCIN desc not available for: %s\n",
- (char *)kw);
+ "VPD: CCIN desc not available for: NULL\n");
}
}
}