linux-stable/arch/s390
Linus Torvalds d412bc9f60 gcc-12: disable '-Warray-bounds' universally for now
[ Upstream commit f0be87c42c ]

In commit 8b202ee218 ("s390: disable -Warray-bounds") the s390 people
disabled the '-Warray-bounds' warning for gcc-12, because the new logic
in gcc would cause warnings for their use of the S390_lowcore macro,
which accesses absolute pointers.

It turns out gcc-12 has many other issues in this area, so this takes
that s390 warning disable logic, and turns it into a kernel build config
entry instead.

Part of the intent is that we can make this all much more targeted, and
use this conflig flag to disable it in only particular configurations
that cause problems, with the s390 case as an example:

        select GCC12_NO_ARRAY_BOUNDS

and we could do that for other configuration cases that cause issues.

Or we could possibly use the CONFIG_CC_NO_ARRAY_BOUNDS thing in a more
targeted way, and disable the warning only for particular uses: again
the s390 case as an example:

  KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)

but this ends up just doing it globally in the top-level Makefile, since
the current issues are spread fairly widely all over:

  KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds

We'll try to limit this later, since the gcc-12 problems are rare enough
that *much* of the kernel can be built with it without disabling this
warning.

Cc: Kees Cook <keescook@chromium.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-22 14:27:55 +02:00
..
appldata
boot s390: remove invalid email address of Heiko Carstens 2022-02-06 23:31:29 +01:00
configs s390: enable CONFIG_HARDENED_USERCOPY in debug_defconfig 2022-04-12 11:56:08 +02:00
crypto s390/crypto: fix scatterwalk_unmap() callers in AES-GCM 2022-06-14 18:44:53 +02:00
hypfs s390/extable: move EX_TABLE define to asm-extable.h 2022-03-08 00:33:00 +01:00
include kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] 2022-06-09 10:30:51 +02:00
kernel s390/mcck: isolate SIE instruction when setting CIF_MCCK_GUEST flag 2022-06-14 18:44:59 +02:00
kvm KVM: s390: Fix lockdep issue in vm memop 2022-05-02 19:45:03 +02:00
lib s390: current_stack_pointer shouldn't be a function 2022-04-12 11:56:08 +02:00
mm s390/gmap: voluntarily schedule during key setting 2022-06-14 18:45:15 +02:00
net s390: raise minimum supported machine generation to z10 2022-03-10 15:58:17 +01:00
pci s390/pci: rename get_zdev_by_bus() to zdev_from_bus() 2022-03-27 22:18:40 +02:00
purgatory
tools s390: raise minimum supported machine generation to z10 2022-03-10 15:58:17 +01:00
Kbuild
Kconfig gcc-12: disable '-Warray-bounds' universally for now 2022-06-22 14:27:55 +02:00
Kconfig.debug
Makefile gcc-12: disable '-Warray-bounds' universally for now 2022-06-22 14:27:55 +02:00