mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
Merge 3fe617ccaf ("Enable '-Werror' by default for all kernel builds") into android-mainline
Steps on the way to 5.15-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I0cb711ea7aab52e2670192f1a03ca9fbe9d4c166
This commit is contained in:
3
Makefile
3
Makefile
@@ -801,6 +801,9 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong
|
||||
|
||||
KBUILD_CFLAGS += $(stackp-flags-y)
|
||||
|
||||
KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
|
||||
KBUILD_CFLAGS += $(KBUILD_CFLAGS-y)
|
||||
|
||||
ifdef CONFIG_CC_IS_CLANG
|
||||
KBUILD_CPPFLAGS += -Qunused-arguments
|
||||
# The kernel builds with '-std=gnu89' so use of GNU extensions is acceptable.
|
||||
|
||||
14
init/Kconfig
14
init/Kconfig
@@ -137,6 +137,20 @@ config COMPILE_TEST
|
||||
here. If you are a user/distributor, say N here to exclude useless
|
||||
drivers to be distributed.
|
||||
|
||||
config WERROR
|
||||
bool "Compile the kernel with warnings as errors"
|
||||
default y
|
||||
help
|
||||
A kernel build should not cause any compiler warnings, and this
|
||||
enables the '-Werror' flag to enforce that rule by default.
|
||||
|
||||
However, if you have a new (or very old) compiler with odd and
|
||||
unusual warnings, or you have some architecture with problems,
|
||||
you may need to disable this config option in order to
|
||||
successfully build the kernel.
|
||||
|
||||
If in doubt, say Y.
|
||||
|
||||
config UAPI_HEADER_TEST
|
||||
bool "Compile test UAPI headers"
|
||||
depends on HEADERS_INSTALL && CC_CAN_LINK
|
||||
|
||||
Reference in New Issue
Block a user