From 24d3c9d3527bdd3d1a74de03d8069c66c201c7ffe67e1a5a2bbc5889a727fe99 Mon Sep 17 00:00:00 2001 From: Bruce Rogers Date: Wed, 29 May 2019 17:48:52 +0000 Subject: [PATCH] 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 --- ...-target-ppc-ensure-we-get-null-termi.patch | 24 ++++++++++++++ ...-configure-only-populate-roms-if-sof.patch | 33 +++++++++++++++++++ ...-pc-bios-s390-ccw-net-avoid-warning-.patch | 24 ++++++++++++++ qemu-linux-user.changes | 9 +++++ qemu-linux-user.spec | 6 ++++ qemu-testsuite.changes | 16 +++++++++ qemu-testsuite.spec | 8 +++++ qemu.changes | 16 +++++++++ qemu.spec | 8 +++++ qemu.spec.in | 2 ++ skiboot-gcc9-compat.patch | 26 +++++++++++++++ 11 files changed, 172 insertions(+) create mode 100644 0046-target-ppc-ensure-we-get-null-termi.patch create mode 100644 0047-configure-only-populate-roms-if-sof.patch create mode 100644 0048-pc-bios-s390-ccw-net-avoid-warning-.patch create mode 100644 skiboot-gcc9-compat.patch diff --git a/0046-target-ppc-ensure-we-get-null-termi.patch b/0046-target-ppc-ensure-we-get-null-termi.patch new file mode 100644 index 00000000..603a5dc1 --- /dev/null +++ b/0046-target-ppc-ensure-we-get-null-termi.patch @@ -0,0 +1,24 @@ +From: Bruce Rogers +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 +--- + 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); + } diff --git a/0047-configure-only-populate-roms-if-sof.patch b/0047-configure-only-populate-roms-if-sof.patch new file mode 100644 index 00000000..83edf07f --- /dev/null +++ b/0047-configure-only-populate-roms-if-sof.patch @@ -0,0 +1,33 @@ +From: Bruce Rogers +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 +--- + 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" diff --git a/0048-pc-bios-s390-ccw-net-avoid-warning-.patch b/0048-pc-bios-s390-ccw-net-avoid-warning-.patch new file mode 100644 index 00000000..ff543e79 --- /dev/null +++ b/0048-pc-bios-s390-ccw-net-avoid-warning-.patch @@ -0,0 +1,24 @@ +From: Bruce Rogers +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 +--- + 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)$@") diff --git a/qemu-linux-user.changes b/qemu-linux-user.changes index ca272673..12690d55 100644 --- a/qemu-linux-user.changes +++ b/qemu-linux-user.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed May 29 16:03:58 UTC 2019 - Bruce Rogers + +- 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 diff --git a/qemu-linux-user.spec b/qemu-linux-user.spec index a1108587..65a56ed2 100644 --- a/qemu-linux-user.spec +++ b/qemu-linux-user.spec @@ -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} diff --git a/qemu-testsuite.changes b/qemu-testsuite.changes index 57c88e49..db781822 100644 --- a/qemu-testsuite.changes +++ b/qemu-testsuite.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Wed May 29 16:03:57 UTC 2019 - Bruce Rogers + +- 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 diff --git a/qemu-testsuite.spec b/qemu-testsuite.spec index 67707ccc..748cf0d8 100644 --- a/qemu-testsuite.spec +++ b/qemu-testsuite.spec @@ -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 diff --git a/qemu.changes b/qemu.changes index 57c88e49..db781822 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Wed May 29 16:03:57 UTC 2019 - Bruce Rogers + +- 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 diff --git a/qemu.spec b/qemu.spec index 60b797da..1069603e 100644 --- a/qemu.spec +++ b/qemu.spec @@ -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 diff --git a/qemu.spec.in b/qemu.spec.in index 1d11ae7f..2754d1e3 100644 --- a/qemu.spec.in +++ b/qemu.spec.in @@ -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 diff --git a/skiboot-gcc9-compat.patch b/skiboot-gcc9-compat.patch new file mode 100644 index 00000000..680b85b5 --- /dev/null +++ b/skiboot-gcc9-compat.patch @@ -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"); + } + } + }