Re: [PATCH v3 29/30] selftests/nolibc: Append extra cflags

From: Leo Yan

Date: Tue Mar 10 2026 - 12:09:53 EST


On Mon, Mar 09, 2026 at 11:24:58PM +0100, Thomas Weißschuh wrote:
> Hi Leo,
>
> On 2026-03-08 16:46:34+0000, Leo Yan wrote:
> > Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> > the compiler.
> >
> > Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
> > ---
> > tools/testing/selftests/nolibc/Makefile.nolibc | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc
> > index f5704193038f7da935d57e0f894970b6e29b78da..e58b2f5eb2b231bb1c194db7365fff7b4e244e5d 100644
> > --- a/tools/testing/selftests/nolibc/Makefile.nolibc
> > +++ b/tools/testing/selftests/nolibc/Makefile.nolibc
> > @@ -252,6 +252,9 @@ endif
> > # Modify CFLAGS based on LLVM=
> > include $(srctree)/tools/scripts/Makefile.include
> >
> > +# Append EXTRA_CFLAGS if it is set in tools/scripts/Makefile.include
> > +CFLAGS += $(EXTRA_CFLAGS)
>
> Makefile.nolibc here is completely self-contained. It is not expected to
> inherit any flags from the regular selftests. So I don't think this makes
> sense. There is a similar, custom "CFLAGS_EXTRA" variable, which could
> be aligned, but probably not as part of this series.
>
> There is a regular 'Makefile' in this directory which *is* integrated
> with the regular selftest build system. If you could make sure that
> it works correctly with what you are doing, that would be great.

Sure, I will update the regular Makefile.

As you suggested, I also will drop patch 18 in new version.

Thanks for suggestions!