dreemurrs-embedded / Jumpdrive

Flash/Rescue SD Card image for PinePhone and PineTab. This is NOT a bootloader
GNU General Public License v2.0
482 stars 62 forks source link

librem5: workaround atf bug on some compilers #76

Open Danct12 opened 2 years ago

Danct12 commented 2 years ago

According to @craftyguy, there's a bug with GCC 12.1 that caused the compilation to fail:

+ make PLAT=imx8mq CROSS_COMPILE=aarch64-linux-gnu- bl31
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/tmp/Jumpdrive/build/u-boot/librem5/arm-trusted-firmware'
  CC      plat/imx/imx8mq/imx8mq_bl31_setup.c
  CC      plat/imx/imx8mq/src.c
In file included from plat/imx/imx8mq/src.c:13:
In function 'mmio_read_8',
    inlined from 'imx_soc_handler' at plat/imx/imx8mq/src.c:59:16:
include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]
   19 |         return *(volatile uint8_t*)addr;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
In function 'mmio_read_8',
    inlined from 'imx_soc_handler' at plat/imx/imx8mq/src.c:61:17:
include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]
   19 |         return *(volatile uint8_t*)addr;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:711: build/imx8mq/release/bl31/src.o] Error 1
make[1]: Leaving directory '/tmp/Jumpdrive/build/u-boot/librem5/arm-trusted-firmware'
make: *** [Makefile:247: u-boot-librem5.bin] Error 2