From e75c29e7c8be4ae62f2ab68eb1e18e22dca06a88 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 13 Aug 2019 09:30:57 +0200 Subject: [PATCH] Automatically detect GNU jobserver with -flto. 2019-08-13 Martin Liska * doc/invoke.texi: Document automatic detection of jobserver. * lto-wrapper.c (run_gcc): Detect jobserver always. From-SVN: r274329 --- gcc/ChangeLog | 5 +++++ gcc/doc/invoke.texi | 3 ++- gcc/lto-wrapper.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 082ebe71613..684c30e56cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-08-13 Martin Liska + + * doc/invoke.texi: Document automatic detection of jobserver. + * lto-wrapper.c (run_gcc): Detect jobserver always. + 2019-08-13 Uroš Bizjak * config/i386/i386.md (ix86_expand_vector_set) : diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5b6b824bdd3..0000d358e48 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10422,7 +10422,8 @@ job server mode to determine the number of parallel jobs. This is useful when the Makefile calling GCC is already executing in parallel. You must prepend a @samp{+} to the command recipe in the parent Makefile for this to work. This option likely only works if @env{MAKE} is -GNU make. +GNU make. Even without the option value, GCC tries to automatically +detect a running GNU make's job server. Use @option{-flto=auto} to use GNU make's job server, if available, or otherwise fall back to autodetection of the number of CPU threads diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index c88b8ecf18a..68f63da910f 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1423,7 +1423,7 @@ run_gcc (unsigned argc, char *argv[]) auto_parallel = 0; parallel = 0; } - else if (!jobserver && auto_parallel) + else if (!jobserver) jobserver = jobserver_active_p (); if (linker_output) -- 2.30.2