kumquat-buildroot/board
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-efi configs/aarch64_efi: bump kernel version and update 2021-05-04 22:12:36 +02:00
acmesystems configs/acmesystems_acqua_a5: new defconfigs 2021-03-30 22:15:58 +02:00
altera/socrates_cyclone5
amarula
andes
arcturus
arm
armadeus
arrow/avenger96 configs/avenger96_defconfig: add support for Arrow Avenger96 board 2021-02-08 16:25:00 +01:00
asus/tinker
atmel configs/microchip_sama5d2_icp: new defconfigs 2021-05-19 14:44:19 +02:00
avnet/s6lx9_microboard
bananapi
beagleboardx15
beaglebone board/beaglebone: remove genimage_linux41.cfg 2021-03-29 09:14:04 +02:00
beagleboneai
beaglev configs/beaglev: enable host jh71xx-tools 2021-05-15 14:12:17 +02:00
beelink/gs1
boundarydevices/common board/boundarydevices: update readme.txt for nitrogen8mp 2021-04-28 23:37:00 +02:00
chromebook
ci20
csky
cubietech/cubieboard2
embest/riotboard
engicam
firefly/roc-rk3399-pc
freescale configs/freescale_imx8mpevk: new defconfig 2021-03-27 14:23:16 +01:00
friendlyarm configs: rename a bunch of friendlyarm boards 2021-03-01 22:53:35 +01:00
globalscale/espressobin
grinn
hardkernel
intel/galileo
kontron/smarc-sal28
lego/ev3
lemaker/bananapro
librecomputer/lafrite
licheepi
linksprite/pcduino
microchip configs/microchip_sama5d2_icp: new defconfigs 2021-05-19 14:44:19 +02:00
minnowboard configs/minnowboard_max-graphical_defconfig: unbreak X11/mesa 2021-06-06 09:32:31 +02:00
nexbox/a95x configs/nexbox_a95x_defconfig: bump to kernel 5.10.12 2021-02-04 18:15:09 +01:00
olimex
olpc
openblocks/a6
orangepi configs/orangepi_r1_defconfig: fix typo in comment 2021-02-03 23:16:09 +01:00
pandaboard
pc
pcengines/apu2
pine64
qemu board/qemu/sparc64-sun4u: avoid gcc-11 warning to build the kernel 2021-06-20 18:40:05 +02:00
qmtech/zynq
radxa
raspberrypi board/raspberrypi: add Compute Module 4/IO Board support (64 Bit) 2021-05-20 09:53:30 +02:00
roseapplepi
sheevaplug
sifive/hifive-unleashed
sinovoip
solidrun
stmicroelectronics configs/stm32f469_disco: fix kernel bootup 2021-06-16 23:09:34 +02:00
synopsys
technexion
technologic
toradex/apalis-imx6
udoo
uevm5432 configs/uevm5432: new defconfig 2021-05-19 13:42:28 +02:00
wandboard
warp7
zynq
zynqmp
raspberrypi0
raspberrypi0w
raspberrypi2
raspberrypi3
raspberrypi3-64
raspberrypi4
raspberrypi4-64
raspberrypicm4io board/raspberrypi: add Compute Module 4/IO Board support 2021-05-20 09:53:29 +02:00
raspberrypicm4io-64 board/raspberrypi: add Compute Module 4/IO Board support (64 Bit) 2021-05-20 09:53:30 +02:00