Re: [PATCH v3 1/2] kbuild: move -Werror from KBUILD_CFLAGS to KBUILD_CPPFLAGS

From: Nick Desaulniers
Date: Fri Oct 14 2022 - 16:19:33 EST


On Fri, Oct 14, 2022 at 9:03 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> On Thu, Oct 13, 2022 at 03:01:17AM +0900, Masahiro Yamada wrote:
> > CONFIG_WERROR turns warnings into errors, which happens only for *.c
> > files because -Werror is added to KBUILD_CFLAGS.
> >
> > Adding it to KBUILD_CPPFLAGS makes more sense because preprocessors
> > understand the -Werror option.
> >
> For what it's worth, this is going to break 32-bit ARM builds with clang
> plus the integrated assembler due to
> https://github.com/ClangBuiltLinux/linux/issues/1315:
>
> clang-16: error: argument unused during compilation: '-march=armv7-a' [-Werror,-Wunused-command-line-argument]

Ah, sorry, I should have finished off that series back then. I've
rebased the series and sent a v4.
https://lore.kernel.org/llvm/20221014201354.3190007-1-ndesaulniers@xxxxxxxxxx/

You mentioned to me on IRC
https://lore.kernel.org/linux-next/CAK7LNARg8OpqLR_71PJV3ZoLuDV8+mz9mphg=CzEeEEMY0G3rw@xxxxxxxxxxxxxx/
maybe will be a conflict.

>
> Ultimately, I want -Wunused-command-line-argument to be an error anyways
> (https://github.com/ClangBuiltLinux/linux/issues/1587) but it would be
> nice to get these cleaned up before this goes in.
>
> Cheers,
> Nathan



--
Thanks,
~Nick Desaulniers