This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Come up with -flto=auto option.


On 7/24/19 12:11 AM, Allan Sandfeld Jensen wrote:
> On Dienstag, 23. Juli 2019 10:30:07 CEST Martin Liška wrote:
>> Hi.
>>
>> As we as openSUSE started using -flto, I see it very handy to have
>> an option value that will automatically detect number of cores
>> that can be used for parallel LTRANS phase.
>>
>> Thoughts?
>>
> That's really nice. 
> 
> How much extra work would it be to make it support a posix make jobserver? 

We do support it via -flto=jobserver:

           You can also specify -flto=jobserver to use GNU make's 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 + to the command recipe in the parent
           Makefile for this to work.  This option likely only works if MAKE is GNU make.

Problem is that nowadays you how much more common make systems like ninja, meson and others
that probably do not support that.

> 
> As far as I understand, you would need to guess a partition size first (as 
> your patch here does), but then only start each job when given a token from 
> the jobserver FD.
> 
> With that the integration to existing build infrastructure would be optimal.

Fully agree with you. Maybe a new (more generic) infrastructure (API) would be welcome.

Martin

> 
> Cheers
> 'Allan
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]