mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10.git
synced 2026-09-09 00:07:04 +08:00
The -Werror flag should be enabled for RHEL. In ARK, however, it is a bit
tricky to enable -Werror as a build bug occasionally leaks through
upstream review and into Linus' tree. As a consequence, CONFIG_WERROR
cannot be enabled in ARK but the code to add the flag for RHEL commpiles
can be added to the top-level makefile.
This code could be placed in the top-level Makefile, around the -Werror
line added by Linus in 3fe617ccaf ("Enable '-Werror' by default for all
kernel builds"), but given the amount of RHEL Only code here it is best to
keep it separated in our top-level makefile.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
24 lines
635 B
Makefile
24 lines
635 B
Makefile
ifeq ($(filter dist-% distg-%,$(MAKECMDGOALS)),)
|
|
include Makefile
|
|
endif
|
|
|
|
_OUTPUT := "."
|
|
# this section is needed in order to make O= to work
|
|
ifeq ("$(origin O)", "command line")
|
|
_OUTPUT := "$(abspath $(O))"
|
|
_EXTRA_ARGS := O=$(_OUTPUT)
|
|
endif
|
|
dist-%::
|
|
$(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
|
|
|
|
distg-%::
|
|
$(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
|
|
|
|
ifeq (,$(filter $(ARCH), x86 x86_64 powerpc s390 aarch64))
|
|
ifneq ($(KBUILD_EXTMOD),)
|
|
# always strip out error flags for external modules
|
|
KBUILD_CPPFLAGS := $(filter-out -Werror,$(KBUILD_CPPFLAGS))
|
|
KBUILD_RUSTFLAGS := $(filter-out -Dwarnings,$(KBUILD_RUSTFLAGS))
|
|
endif
|
|
endif
|