[PATCH v2 2/6] Makefile: Run the subdirectory recursion in parallel

H.J. Lu hjl.tools@gmail.com
Mon Jul 6 00:54:55 GMT 2026


On Fri, Jul 3, 2026 at 11:27 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 03/07/26 07:57, Sam James wrote:
> > Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> >
> >>
> >>  .PHONY: $(+subdir_targets) $(all-subdirs-targets)
> >> +
> >> +# Encode the topological ordering computed by scripts/gen-sorted.awk as
> >> +# explicit dependencies between the per-subdirectory targets, so that
> >> +# independent subdirectories build concurrently:
> >
> > I suggest: ". In summary:"
> >
> > It makes clear that there's independent comments below about the same thing.
>
> Ack.
>
> >> +# Building and running a subdirectory's tests are fused in its sub-make,
> >> +# and run-built-tests is fixed for a make instance, so the only way to
> >> +# build every test program with the recursion fully parallel while the
> >> +# run still honors the per-subdirectory .NOTPARALLEL (nptl/htl/rt) and the
> >> +# run-time ordering is to use two passes.  At the top level, 'make check'
> >> +# therefore builds the test programs (run-built-tests=no, recursion fully
> >> +# parallel) and then runs them (run-built-tests=yes).  'make tests' and a
> >> +# subdirectory's own 'check' stay single pass.
> >
> > Nit: single-pass.
>
> Ack.
>
> >> index 5bad0333a5a..0e5a8b8f689 100644
> >> --- a/htl/Makefile
> >> +++ b/htl/Makefile
> >> @@ -257,3 +257,10 @@ $(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(srcdir)/libpthread_sy
> >>  else
> >>  $(addprefix $(objpfx),$(tests) $(test-srcs)): $(srcdir)/libpthread_syms.a $(objpfx)libpthread.a
> >>  endif
> >> +
> >> +# The tests here better do not run in parallel.
> >
> > Say something like: "Like rt, these tests prefer to be run serially."
>
> Ack.
>
> >
> >> +ifeq ($(run-built-tests),yes)
> >> +ifneq ($(filter %tests,$(MAKECMDGOALS)),)
> >> +.NOTPARALLEL:
> >> +endif
> >> +endif
> >> diff --git a/rt/Makefile b/rt/Makefile
> >> index 39a3e5620b3..24e43a87599 100644
> >> --- a/rt/Makefile
> >> +++ b/rt/Makefile
> >> @@ -109,3 +109,11 @@ LDFLAGS-rt.so = -Wl,--enable-new-dtags,-z,nodelete
> >>  $(objpfx)librt.so: $(shared-thread-library)
> >>
> >>  tst-mqueue7-ARGS = -- $(host-test-program-cmd)
> >> +
> >> +# The timer and message-queue tests here are timing-sensitive and better
> >> +# do not run in parallel.
> >> +ifeq ($(run-built-tests),yes)
> >> +ifneq ($(filter %tests,$(MAKECMDGOALS)),)
> >> +.NOTPARALLEL:
> >> +endif
> >> +endif
> >
> > Reviewed-by: Sam James <sam@gentoo.org>
> >
> > The changes look good. Also, when testing, thus far I only had one small
> > issue:
> > https://inbox.sourceware.org/libc-alpha/822344f7cd03b8f199d0e612868221d13d14300d.1783035357.git.sam@gentoo.org/
> Thanks for the review, I was about to check on this but I noticed Collin
> already reviewed it.

This caused:

https://sourceware.org/bugzilla/show_bug.cgi?id=34355

-- 
H.J.


More information about the Libc-alpha mailing list