This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Come up with -flto=auto option.
- From: Martin Liška <mliska at suse dot cz>
- To: Allan Sandfeld Jensen <linux at carewolf dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Jul 2019 08:45:21 +0200
- Subject: Re: [PATCH] Come up with -flto=auto option.
- References: <email@example.com> <4500039.31r3eYUQgx@twilight>
On 7/24/19 12:11 AM, Allan Sandfeld Jensen wrote:
> On Dienstag, 23. Juli 2019 10:30:07 CEST Martin Liška wrote:
>> 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.
> 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.