[PATCH RFC next 15/18] kbuild: enable -Werror for hostprogs

Ilias Apalodimas ilias.apalodimas at linaro.org
Tue May 5 07:51:51 CEST 2026


On Mon, 4 May 2026 at 16:20, Quentin Schulz <foss+uboot at 0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz at cherry.de>
>
> [ Upstream commit 27758d8c2583d10472b745a43ff86fef96c11ef7 ]
>
> Original commit log:
>
>   The hostprog compilers and linkers do not share the regular compiler flags,
>   so they are not affected by CONFIG_WERROR or W=e. As hostprogs are used
>   during the bootstrap of the build, they can't depend on kconfig options.
>
>   Enable -Werror unconditionally.
>
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
> ---

Doesn't the next patch reverts this? I think you can squash them in a
single patch

Thanks
/Ilias
>  scripts/Makefile.extrawarn | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 29b6aab5f72..8988308cc36 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -109,3 +109,8 @@ KBUILD_LDFLAGS              += --fatal-warnings
>  KBUILD_RUSTFLAGS       += -Dwarnings
>
>  endif
> +
> +# Hostprog flags are used during build bootstrapping and can not rely on CONFIG_ symbols.
> +KBUILD_HOSTCFLAGS      += -Werror
> +KBUILD_HOSTLDFLAGS     += -Wl,--fatal-warnings
> +KBUILD_HOSTRUSTFLAGS   += -Dwarnings
>
> --
> 2.54.0
>


More information about the U-Boot mailing list