On 2020-10-28, H.J. Lu <hjl.to...@gmail.com> wrote: > GCC introduced some time ago option -flto=jobserver in order to use the > GNU Make jobserver when parallelising LTO builds. It is actually a > similar "recursive make". When doing a recursive make, you need to > place a '+' character at the beginning of the recipe line in order to > let GNU Make pass the jobserver file descriptors to the child processes. > > Add the --jobserver option to add a '+' character to the recipe line in > program.am and ltlibrary.am. [...] > @@ -8100,6 +8106,7 @@ Operation modes: > --version print version number, then exit > -v, --verbose verbosely list files processed > --no-force only update Makefile.in's that are out of date > + --jobserver enable GNU make jobserver > -W, --warnings=CATEGORY report the warnings falling in CATEGORY > > Dependency tracking: > @@ -8176,6 +8183,7 @@ sub parse_arguments () > 'include-deps' => sub { $ignore_deps = 0; }, > 'i|ignore-deps' => sub { $ignore_deps = 1; }, > 'no-force' => sub { $force_generation = 0; }, > + 'jobserver' => sub { $enable_jobserver = '+ '; }, > 'f|force-missing' => \$force_missing, > 'a|add-missing' => \$add_missing, > 'c|copy' => \$copy_missing, > diff --git a/doc/automake.texi b/doc/automake.texi > index 17bc2dae6..d09b1d94a 100644 > --- a/doc/automake.texi > +++ b/doc/automake.texi > @@ -2719,6 +2719,11 @@ This enables the dependency tracking feature. This > feature is enabled > by default. This option is provided for historical reasons only and > probably should not be used. > > +@item --jobserver > +@opindex --jobserver > +This enables the GNU make jobserver feature support for GCC > -flto=jobserver > +option.
Surely this needs to be a configure-time option, perhaps combined with some sort of configure test, since otherwise users won't get this choice, right? As an automake option the choice made by whomever prepares the distribution will get baked into distributed Makefile.in files... [...] > diff --git a/lib/am/program.am b/lib/am/program.am > index 9a243b399..4df9cbeee 100644 > --- a/lib/am/program.am > +++ b/lib/am/program.am > @@ -21,4 +21,4 @@ > ## Or maybe not... sadly, incremental linkers are rarer than losing > ## systems. > @rm -f %PROGRAM%%EXEEXT% > - %VERBOSE%$(%XLINK%) $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_LDADD) $(LIBS) > + %JOBSERVER%%VERBOSE%$(%XLINK%) $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_LDADD) This will break "make -n", won't it? Some sort of test of $(MAKEFLAGS) is probably required in this command. Cheers, Nick