gcc-12: build errors: arch/arm64/kernel/setup.c:225:56: warning: array subscript -1 is outside array bounds of 'char[]' [-Warray-bounds]

Naresh Kamboju naresh.kamboju at linaro.org
Thu Jun 2 19:03:08 PDT 2022


While building Linux kernel with gcc-12 for arm64 the following warnings/errors
noticed. These are specific to gcc-12 builds.

Reported-by: Linux Kernel Functional Testing <lkft at linaro.org>

make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/2/build
CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu- 'CC=sccache aarch64-linux-gnu-gcc'
'HOSTCC=sccache gcc'
In file included from arch/arm64/include/asm/thread_info.h:17,
                 from include/linux/thread_info.h:60,
                 from arch/arm64/include/asm/preempt.h:6,
                 from include/linux/preempt.h:78,
                 from include/linux/smp.h:110,
                 from include/linux/lockdep.h:14,
                 from include/linux/mutex.h:17,
                 from include/linux/kernfs.h:11,
                 from include/linux/sysfs.h:16,
                 from include/linux/kobject.h:20,
                 from include/linux/of.h:17,
                 from include/linux/irqdomain.h:35,
                 from include/linux/acpi.h:13,
                 from arch/arm64/kernel/setup.c:9:
In function 'request_standard_resources',
    inlined from 'setup_arch' at arch/arm64/kernel/setup.c:350:2:
arch/arm64/kernel/setup.c:225:56: warning: array subscript -1 is
outside array bounds of 'char[]' [-Warray-bounds]
  225 |         kernel_code.end     = __pa_symbol(__init_begin - 1);

steps to reproduce:
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake

tuxmake --runtime podman --target-arch arm64 --toolchain gcc-12
--kconfig tinyconfig CROSS_COMPILE_COMPAT=arm-linux-gnueabihf-

Build link:
https://builds.tuxbuild.com/2A2iyFqotDfgkLynaKzmpf8H7Nf/

--
Linaro LKFT
https://lkft.linaro.org



More information about the linux-arm-kernel mailing list