Re: [PATCH v2 2/5] Makefile.compiler: Use KBUILD_AFLAGS for as-option

From: Masahiro Yamada
Date: Wed Sep 07 2022 - 00:15:21 EST


On Wed, Sep 7, 2022 at 1:08 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> On Mon, Sep 05, 2022 at 06:09:28PM +0900, Masahiro Yamada wrote:
> > On Thu, Sep 1, 2022 at 4:53 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
> > >
> > > On Wed, Aug 31, 2022 at 11:44:05AM -0700, Nick Desaulniers wrote:
> > > > as-instr uses KBUILD_AFLAGS, but as-option uses KBUILD_CFLAGS. This can
> > > > cause as-option to fail unexpectedly because clang will emit
> > > > -Werror,-Wunused-command-line-argument for various -m and -f flags for
> > > > assembler sources.
> > >
> > > Now that I am looking closer at it, where does that '-Werror' come from?
> >
> > The related commit is
> > c3f0d0bc5b01ad90c45276952802455750444b4f
> >
> > The previous discussion with Arnd is
> > https://lore.kernel.org/linux-kbuild/20170314213724.3836900-1-arnd@xxxxxxxx/
>
> Right, although this is for cc-option, not as-option, no?



Sorry, I misunderstood your comments.
My reference is about -Werror in cc-option. It is unrelated to as-option.



You are right.
Currently, as-option takes KBUILD_CFLAGS instead of KBUILD_AFLAGS.

The '-Werror,' of -Werror,-Wunused-command-line-argument
presumably came from CONFIG_WERROR.





--
Best Regards
Masahiro Yamada