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
arm-versatile configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
arm-vexpress
arm-vexpress-tz configs/qemu_arm_vexpress_tz: bump versions and update 2021-03-20 23:03:46 +01:00
csky
m68k-mcf5208
m68k-q800
microblazebe-mmu
microblazeel-mmu
mips32r2-malta
mips32r2el-malta
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
mips64el-malta
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
or1k
ppc64-e5500
ppc64-pseries
ppc64le-pseries
ppc-e500mc board/qemu: Add ppc-e500mc configuration 2021-03-01 23:50:15 +01:00
ppc-g3beige
ppc-mac99
ppc-mpc8544ds configs/qemu_*: bump kernel version to 5.10.7 2021-01-21 22:36:12 +01:00
riscv32-virt
riscv64-virt
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
x86
x86_64
xtensa-lx60
post-image.sh