diff --git a/arch/alpha/Kbuild b/arch/alpha/Kbuild
index 345d79df24bb9..283cb9d5b022c 100644
--- a/arch/alpha/Kbuild
+++ b/arch/alpha/Kbuild
@@ -4,3 +4,5 @@ obj-$(CONFIG_MATHEMU)	+= math-emu/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile
index 1cc74f7b50efb..09e0be65caa93 100644
--- a/arch/alpha/lib/Makefile
+++ b/arch/alpha/lib/Makefile
@@ -5,6 +5,7 @@
 
 asflags-y := $(KBUILD_CFLAGS)
 ccflags-y := -Werror
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 # Many of these routines have implementations tuned for ev6.
 # Choose them iff we're targeting ev6 specifically.
diff --git a/arch/arc/Kbuild b/arch/arc/Kbuild
index b94102fff68b4..9bc728209f747 100644
--- a/arch/arc/Kbuild
+++ b/arch/arc/Kbuild
@@ -4,3 +4,5 @@ obj-y += mm/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/csky/Kbuild b/arch/csky/Kbuild
index 0621eaea41962..1d4322ebc95e5 100644
--- a/arch/csky/Kbuild
+++ b/arch/csky/Kbuild
@@ -4,3 +4,5 @@ obj-y += kernel/ mm/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/hexagon/Kbuild b/arch/hexagon/Kbuild
index 8421baba13518..9aceffc706d4a 100644
--- a/arch/hexagon/Kbuild
+++ b/arch/hexagon/Kbuild
@@ -1,2 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y += kernel/ mm/ lib/
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/ia64/Kbuild b/arch/ia64/Kbuild
index e77cc76d228cd..69e3c2dadde0e 100644
--- a/arch/ia64/Kbuild
+++ b/arch/ia64/Kbuild
@@ -1,3 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y				+= kernel/ mm/
 obj-$(CONFIG_IA64_SGI_UV)	+= uv/
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 081fcba01dc0c..03999c9f19bb3 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -2,6 +2,7 @@
 #
 # Makefile for ia64-specific library routines..
 #
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 lib-y := io.o __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o		\
 	__divdi3.o __udivdi3.o __moddi3.o __umoddi3.o			\
diff --git a/arch/loongarch/Kbuild b/arch/loongarch/Kbuild
index b01f5cdb27e03..f3b89e5f79050 100644
--- a/arch/loongarch/Kbuild
+++ b/arch/loongarch/Kbuild
@@ -5,3 +5,5 @@ obj-y += vdso/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/m68k/Kbuild b/arch/m68k/Kbuild
index 7762af9f6defe..b2abbf427e8f2 100644
--- a/arch/m68k/Kbuild
+++ b/arch/m68k/Kbuild
@@ -18,3 +18,5 @@ obj-$(CONFIG_M68KFPU_EMU)	+= math-emu/
 obj-$(CONFIG_M68000)		+= 68000/
 obj-$(CONFIG_COLDFIRE)		+= coldfire/
 obj-$(CONFIG_VIRT)		+= virt/
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index eca17f14b4d5e..3aea84ffa0db2 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -3,6 +3,7 @@
 #
 # Makefile for m68k-specific library files..
 #
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
 	   memcpy.o memset.o memmove.o
diff --git a/arch/microblaze/Kbuild b/arch/microblaze/Kbuild
index 077a0b8e96157..b2799946ae01d 100644
--- a/arch/microblaze/Kbuild
+++ b/arch/microblaze/Kbuild
@@ -6,3 +6,5 @@ obj-y			+= boot/dts/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/mips/Kbuild b/arch/mips/Kbuild
index af2967bffb73d..484cfda563b68 100644
--- a/arch/mips/Kbuild
+++ b/arch/mips/Kbuild
@@ -28,3 +28,5 @@ endif
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 6cc28173bee89..58be7966d839f 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -11,9 +11,10 @@
 # Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University
 # Author: Wu Zhangjin <wuzhangjin@gmail.com>
 #
-
 include $(srctree)/arch/mips/Kbuild.platforms
 
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
+
 # set the default size of the mallocing area for decompressing
 BOOT_HEAP_SIZE := 0x400000
 
diff --git a/arch/nios2/Kbuild b/arch/nios2/Kbuild
index fc2952edd2dec..5f79d266fd4ef 100644
--- a/arch/nios2/Kbuild
+++ b/arch/nios2/Kbuild
@@ -4,3 +4,5 @@ obj-y += kernel/ mm/ platform/ boot/dts/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/nios2/lib/Makefile b/arch/nios2/lib/Makefile
index 9d5bf1df520c1..9acc5a98760fa 100644
--- a/arch/nios2/lib/Makefile
+++ b/arch/nios2/lib/Makefile
@@ -2,6 +2,7 @@
 #
 # Makefile for Nios2-specific library files.
 #
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 lib-y += delay.o
 lib-y += memcpy.o
diff --git a/arch/openrisc/Kbuild b/arch/openrisc/Kbuild
index b0b0f2b03f872..ba60f445bf429 100644
--- a/arch/openrisc/Kbuild
+++ b/arch/openrisc/Kbuild
@@ -4,3 +4,5 @@ obj-y += boot/dts/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/parisc/Kbuild b/arch/parisc/Kbuild
index a6d3b280ba0c2..b825fb5cf9226 100644
--- a/arch/parisc/Kbuild
+++ b/arch/parisc/Kbuild
@@ -3,3 +3,5 @@ obj-y	+= mm/ kernel/ math-emu/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/parisc/lib/Makefile b/arch/parisc/lib/Makefile
index 7b197667faf6c..348a286ab68fe 100644
--- a/arch/parisc/lib/Makefile
+++ b/arch/parisc/lib/Makefile
@@ -2,6 +2,7 @@
 #
 # Makefile for parisc-specific library files
 #
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 lib-y	:= lusercopy.o bitops.o checksum.o io.o memset.o memcpy.o \
 	   ucmpdi2.o delay.o
diff --git a/arch/sh/Kbuild b/arch/sh/Kbuild
index 056efec72c2a0..df2cf06eea5f6 100644
--- a/arch/sh/Kbuild
+++ b/arch/sh/Kbuild
@@ -7,3 +7,5 @@ obj-$(CONFIG_HD6446X_SERIES)	+= cchips/hd6446x/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
index b5e29f99c02c8..25000003c94eb 100644
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -4,6 +4,7 @@
 #
 # create a compressed vmlinux image from the original vmlinux
 #
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 OBJECTS := head_32.o misc.o cache.o piggy.o \
            ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
diff --git a/arch/sparc/Kbuild b/arch/sparc/Kbuild
index 71cb3d934bf6c..320a4092b334e 100644
--- a/arch/sparc/Kbuild
+++ b/arch/sparc/Kbuild
@@ -12,3 +12,5 @@ obj-$(CONFIG_SPARC64) += vdso/
 
 # for cleaning
 subdir- += boot
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 063556fe2cb1d..2a5cba8e68dfd 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -4,6 +4,7 @@
 
 asflags-y := -ansi -DST_DIV0=0x02
 ccflags-y := -Werror
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 lib-$(CONFIG_SPARC32) += ashrdi3.o
 lib-$(CONFIG_SPARC32) += memcpy.o memset.o
diff --git a/arch/sparc/prom/Makefile b/arch/sparc/prom/Makefile
index 397b79af77f7b..0a82ebb014130 100644
--- a/arch/sparc/prom/Makefile
+++ b/arch/sparc/prom/Makefile
@@ -4,6 +4,7 @@
 #
 asflags := -ansi
 ccflags := -Werror
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
 
 lib-y                 := bootstr_$(BITS).o
 lib-y                 += init_$(BITS).o
diff --git a/arch/xtensa/Kbuild b/arch/xtensa/Kbuild
index fd12f61745bad..f01d1ca727b97 100644
--- a/arch/xtensa/Kbuild
+++ b/arch/xtensa/Kbuild
@@ -1,2 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y += kernel/ mm/ platforms/ boot/dts/
+
+subdir-ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/arch/xtensa/boot/lib/Makefile b/arch/xtensa/boot/lib/Makefile
index 0378a22a08e33..a9f1c1e139389 100644
--- a/arch/xtensa/boot/lib/Makefile
+++ b/arch/xtensa/boot/lib/Makefile
@@ -8,6 +8,8 @@ zlib	:= inffast.c inflate.c inftrees.c
 lib-y	+= $(zlib:.c=.o) zmem.o
 
 ccflags-y	:= -I $(srctree)/lib/zlib_inflate
+ccflags-$(CONFIG_WNO_MISSING_PROTOTYPES) := -Wno-missing-prototypes -Wno-missing-declarations
+
 ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_inflate.o = -pg
 CFLAGS_REMOVE_zmem.o = -pg
diff --git a/init/Kconfig b/init/Kconfig
index 639e8a3363c30..80cd67c0d7fa4 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -170,6 +170,16 @@ config WERROR
 
 	  If in doubt, say Y.
 
+config WNO_MISSING_PROTOTYPES
+	bool "Hide -Wmissing-prototype warnings in arch code"
+	default WERROR || !COMPILE_TEST
+	help
+	  Some architectures have not yet eliminated all warnings for
+	  missing prototypes in their core code and will produce a lot
+	  of output for these. Ideally these should all be addresszed
+	  by individual bugfix patches, but in the meantime saying 'y'
+	  will skip that output.
+
 config UAPI_HEADER_TEST
 	bool "Compile test UAPI headers"
 	depends on HEADERS_INSTALL && CC_CAN_LINK
