linux-stable/arch
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
..
alpha alpha: fix alloc_zeroed_user_highpage_movable() 2022-06-09 10:29:51 +02:00
arc ARC: remove redundant READ_ONCE() in cmpxchg loop 2022-04-18 14:47:05 -07:00
arm ep93xx: clock: Do not return the address of the freed memory 2022-06-14 18:44:55 +02:00
arm64 arm64: dts: imx8mn-beacon: Enable RTS-CTS on UART3 2022-06-22 14:27:47 +02:00
csky csky: patch_text: Fixup last cpu should be master 2022-06-09 10:30:50 +02:00
h8300 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2022-04-01 19:57:03 -07:00
hexagon ptrace: Cleanups for v5.18 2022-03-28 17:29:53 -07:00
ia64 ia64: define get_cycles macro for arch-override 2022-05-30 09:24:04 +02:00
m68k m68knommu: fix undefined reference to `mach_get_rtc_pll' 2022-06-14 18:45:03 +02:00
microblaze Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
mips mips: cpc: Fix refcount leak in mips_cpc_default_phys_base 2022-06-14 18:45:01 +02:00
nios2 nios2: use fallback for random_get_entropy() instead of zero 2022-05-30 09:24:05 +02:00
openrisc openrisc: start CPU timer early in boot 2022-06-09 10:29:44 +02:00
parisc parisc/stifb: Implement fb_is_primary_device() 2022-06-09 10:29:26 +02:00
powerpc powerpc/kasan: Silence KASAN warnings in __get_wchan() 2022-06-22 14:27:48 +02:00
riscv RISC-V: use memcpy for kexec_file mode 2022-06-14 18:45:03 +02:00
s390 gcc-12: disable '-Warray-bounds' universally for now 2022-06-22 14:27:55 +02:00
sh Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2022-04-01 19:57:03 -07:00
sparc signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:30:00 +02:00
um um: line: Use separate IRQs per line 2022-06-14 18:45:13 +02:00
x86 x86/speculation/mmio: Print SMT warning 2022-06-16 13:32:05 +02:00
xtensa xtensa/simdisk: fix proc_read_simdisk() 2022-06-09 10:30:52 +02:00
.gitignore
Kconfig vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP 2022-04-19 12:08:57 -07:00