[PATCH RFC next 08/18] scripts/Makefile.extrawarn: sync with 6.1
Simon Glass
sjg at chromium.org
Mon May 4 22:34:31 CEST 2026
Hi Quentin,
On 2026-05-04T13:20:27, Quentin Schulz <foss+uboot at 0leil.net> wrote:
> scripts/Makefile.extrawarn: sync with 6.1
>
> Sync scripts/Makefile.extrawarn with Linux kernel 6.1's.
>
> Since it adds a new option for KBUILD_EXTRA_WARN with e, document it as
> done in kernel commit c77d06e70d59 ("kbuild: support W=e to make build
> abort in case of warning").
>
> s/gcc/build/ in Makefile as done in kernel commit e27128db6283 ("kbuild:
> rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN"), part of
> v5.4. The rest of this commit was backported with commit bd3f9ee679b4
> ("kbuild: Bump the build system to 6.1").
>
> Our scripts/Makefile.extrawarn before this commit is Linux kernel's from
> v5.1 with the following diff:
>
> # diff --git a/proc/self/fd/11 b/proc/self/fd/13
> # --- a/proc/self/fd/11
> # +++ b/proc/self/fd/13
> # @@ -13,17 +13,8 @@
> [...]
>
> Makefile | 3 +-
> scripts/Makefile.extrawarn | 154 +++++++++++++++++++++++++++------------------
> 2 files changed, 95 insertions(+), 62 deletions(-)
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> @@ -22,64 +17,101 @@ endif
> ifdef CONFIG_CC_IS_CLANG
> -KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
> -KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
> -KBUILD_CFLAGS += $(call cc-disable-warning, format)
> -KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
> -KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
> -KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
> +KBUILD_CFLAGS += -Wno-initializer-overrides
> +# Clang before clang-16 would warn on default argument promotions.
> +ifneq ($(call clang-min-version, 160000),y)
clang-min-version() is not defined anywhere that I can find. So I
believe $(call clang-min-version, 160000) always expands to empty, the
ifneq is always true and the inner ifeq always false.
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> @@ -22,64 +17,101 @@ endif
> -warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
> -warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
> -warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
> -
> -ifeq ("$(strip $(warning))","")
> - $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
> -endif
Dropping this silently accepts make W=q as a no-op. That matches v6.1
so I'm fine with it, but please note the behaviour change in the
commit message so anyone bisecting a "my W=foo did nothing" report
finds it.
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> @@ -22,64 +17,101 @@ endif
> -warning-1 += $(call cc-disable-warning, missing-field-initializers)
> -warning-1 += $(call cc-disable-warning, sign-compare)
> +KBUILD_CFLAGS += -Wmissing-prototypes
> +KBUILD_CFLAGS += -Wold-style-definition
> +KBUILD_CFLAGS += -Wmissing-include-dirs
...
> +KBUILD_CFLAGS += -Wno-missing-field-initializers
> +KBUILD_CFLAGS += -Wno-sign-compare
> +KBUILD_CFLAGS += -Wno-type-limits
> +KBUILD_CFLAGS += -Wno-shift-negative-value
Several flags previously wrapped in cc-option / cc-disable-warning are
now passed unconditionally (-Wmissing-prototypes,
-Wold-style-definition, -Wmissing-include-dirs, -Wno-type-limits,
-Wno-shift-negative-value). That's the v6.1 behaviour, fair enough.
What's the oldest gcc we support?
Regards,
Simon
More information about the U-Boot
mailing list