aarch64:qemu6.2.0 compile error

Host environment

  • Operating system: Linux
  • OS/kernel version: 5.10.0-60.18.0.50.oe2203.aarch64 #1 SMP Wed Mar 30 02:43:08 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
  • Architecture: ARM
  • QEMU flavor:
  • QEMU version:
  • QEMU command line:
  • host cpu:
Architecture:           aarch64
  CPU op-mode(s):       64-bit
  Byte Order:           Little Endian
CPU(s):                 96
  On-line CPU(s) list:  0-95
Vendor ID:              HiSilicon
  BIOS Vendor ID:       HiSilicon
  Model name:           Kunpeng-920
    BIOS Model name:    HUAWEI Kunpeng 920 5250

Emulated/Virtualized environment

  • Operating system:
  • OS/kernel version:
  • Architecture:

Description of problem

Steps to reproduce

  1. download qemu source package wget http://mirrors.163.com/centos-vault/centos/8-stream/AppStream/Source/SPackages/qemu-kvm-6.2.0-12.module_el8.7.0%2b1140%2bff0772f9.src.rpm
  2. install qemu source package rpm -ivh qemu-*.rpm
  3. build qemu rpmbuild --define "_topdir /xxx/src_qemu6.2.0" -bb SPECS/qemu-kvm.spec
  4. error message:
In function 'dump_receive_iov',
    inlined from 'filter_dump_receive_iov' at ../net/dump.c:157:5:
../net/dump.c:89:9: error: 'writev' specified size 18446744073709551600 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
   89 |     if (writev(s->fd, dumpiov, cnt + 1) != sizeof(hdr) + caplen) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/xxx/src_qemu6.2.0/BUILD/qemu-kvm-6.2.0/include/qemu/osdep.h:108,
                 from ../net/dump.c:25:
../net/dump.c: In function 'filter_dump_receive_iov':
/usr/include/sys/uio.h:52:16: note: in a call to function 'writev' declared with attribute 'read_only (2, 3)'
   52 | extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
      |                ^~~~~~
cc1: all warnings being treated as errors

gcc version

# gcc --version
gcc (GCC) 10.3.1
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root]# meson -v
0.62.1
[root]# ninja -v
ninja: error: loading 'build.ninja': No such file or directory
[root@vm77 src_qemu6.2.0]# ninja --version
1.8.2

Additional information

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information