kumquat-buildroot/board/qemu
Romain Naour 6e1106b4a9 board/qemu/sparc64-sun4u: avoid gcc-11 warning to build the kernel
gcc-11 warns about what appears to be an out-of-range array access but
stop the build due to -Werror added to cflags:

arch/sparc/kernel/mdesc.c: In function 'mdesc_node_by_name':
arch/sparc/kernel/mdesc.c:647:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  647 |                 if (!strcmp(names + ep[ret].name_offset, name))
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
   77 |         struct mdesc_hdr        mdesc;
      |                                 ^~~~~
arch/sparc/kernel/mdesc.c: In function 'mdesc_get_property':
arch/sparc/kernel/mdesc.c:692:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  692 |                 if (!strcmp(names + ep->name_offset, name)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
   77 |         struct mdesc_hdr        mdesc;
      |                                 ^~~~~
arch/sparc/kernel/mdesc.c: In function 'mdesc_next_arc':
arch/sparc/kernel/mdesc.c:719:21: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  719 |                 if (strcmp(names + ep->name_offset, arc_type))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
   77 |         struct mdesc_hdr        mdesc;
      |                                 ^~~~~
cc1: all warnings being treated as errors

The issue was initially reported to gcc [1] where it was analized.
As suggested, change the struct mdesc_elem * accesses from the end
of mdesc to those from the beginning of the data array.

Update the prototype of node_block(), name_block() and data_block()
since the code really seems to want to do is to compute the address
somewhere into the chunk pointed to by hp.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100262

Upstream status: Pending
https://www.spinics.net/lists/sparclinux/msg26385.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-06-20 18:40:05 +02:00
..
aarch64-sbsa configs/qemu_aarch64_sbsa_defconfig: new config for QEMU sbsa-ref 2021-05-17 17:26:27 +02:00
aarch64-virt board/qemu/aarch64-virt/linux.config: enable VIRTIO_FS driver 2020-07-11 15:54:17 +02:00
arm-versatile configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
arm-vexpress board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
arm-vexpress-tz configs/qemu_arm_vexpress_tz: bump versions and update 2021-03-20 23:03:46 +01:00
csky board/qemu: add defconfig file name as tag after the qemu command line 2020-04-13 21:51:12 +02:00
m68k-mcf5208 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
m68k-q800 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
microblazebe-mmu board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
microblazeel-mmu board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
mips32r2-malta board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
mips32r2el-malta board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
mips32r6-malta configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
mips32r6el-malta configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
mips64-malta board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
mips64el-malta board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
mips64r6-malta configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
mips64r6el-malta configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
nios2-10m50 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
or1k board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
ppc64-e5500 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
ppc64-pseries board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
ppc64le-pseries board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
ppc-e500mc board/qemu: Add ppc-e500mc configuration 2021-03-01 23:50:15 +01:00
ppc-g3beige board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
ppc-mac99 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
ppc-mpc8544ds configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
riscv32-virt configs/qemu_riscv32_virt: use Linux 5.4 kernel 2020-09-03 23:47:39 +02:00
riscv64-virt board/qemu/riscv64-virt: update qemu cmdline for Qemu >= 5.1 2020-10-03 09:00:59 +02:00
s390x board/qemu/s390x: disable SSP when needed 2021-05-15 16:48:18 +02:00
sh4-r2d board/qemu/sh4*: Remove linux-headers patch 2021-01-30 13:38:58 +01:00
sh4eb-r2d board/qemu/sh4*: Remove linux-headers patch 2021-01-30 13:38:58 +01:00
sparc64-sun4u board/qemu/sparc64-sun4u: avoid gcc-11 warning to build the kernel 2021-06-20 18:40:05 +02:00
sparc-ss10 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
x86 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
x86_64 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
xtensa-lx60 board/qemu: remove the Qemu version from readme.txt 2020-04-26 13:44:21 +02:00
post-image.sh configs/qemu_arm_vexpress_tz_defconfig: build start-qemu.sh 2020-12-05 22:35:07 +01:00