https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127807
Bug ID: 127807
Summary: gcc/Makefile.in relies on MFLAGS w/ explicit -jN for
testsuite parallelism
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
CC: amonakov at gcc dot gnu.org, arsen at gcc dot gnu.org,
mgorny at gentoo dot org
Target Milestone: ---
gcc/Makefile.in (and some other places like for Ada) parses out -j* from
MFLAGS, but I don't think this works if you're using a jobserver.
$ env | grep -i MAKE
GNUMAKEFLAGS=-l32 --output-sync=line --jobserver-auth=fifo:/dev/steve
MAKEFLAGS=-l32 --jobserver-auth=fifo:/dev/steve
When using a jobserver, explicit -jN should be avoided because it stops make
from acting as a client:
$ make -j$(nproc)
make: warning: -j32 forced in submake: resetting jobserver mode.
make: *** No targets specified and no makefile found. Stop.
But if I don't specify -jN for `make check`, it looks like we fallback to the
non-parallel runtest path:
$(lang_checks_parallelized): check-% : site.exp
-rm -rf $(TESTSUITEDIR)/$*-parallel
@if [ -n "$(filter -j%, $(MFLAGS))" ]; then \
...
else \
$(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)"
\
EXPECT=$(EXPECT) \
check_$*_parallelize= check-parallel-$*; \
fi
I'm not sure what a solution looks like here yet. We would want to know how
many tokens we can claim?