This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should the build system use ar rcs instead of ranlib + ar rc?
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: Patrick Palka <patrick at parcs dot ath dot cx>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Sat, 16 Jul 2016 10:27:10 +0200
- Subject: Re: Should the build system use ar rcs instead of ranlib + ar rc?
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.13.1607152122590.1419@idea> <CA+=Sn1m9a1it+VUzS9dbXvNZHiRgqrkErSHRk6VF2WR3swgxKw@mail.gmail.com>
Andrew Pinski <pinskia@gmail.com> writes:
> On Fri, Jul 15, 2016 at 6:46 PM, Patrick Palka <patrick@parcs.ath.cx> wrote:
>> The build step that invokes "ranlib libbackend.a" (which immediately
>> follows the invocation of "ar rc libbackend.a ...") takes over 7 seconds
>> on my machine and causes the entire 450MB archive to be rewritten. By
>> instead making the build system use ar rcs -- so that the archive and
>> its index are built at once -- the time it takes for the compiler to get
>> rebuilt gets reduced by 25%, from 27s to 20s (in a --disable-bootstrap
>> tree after touching a random source file). This is a pretty significant
>> reduction in compile time and disk io.
>>
>> Is this a good idea?
>
> Yes and no. Do we know if all ar support rcs now?
It is easy to find out: run a configure check.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."