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: Patrick Palka <patrick at parcs dot ath dot cx>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Andrew Pinski <pinskia at gmail dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Sat, 16 Jul 2016 14:29:06 -0400
- 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> <m2twfqj8dd.fsf@linux-m68k.org>
On Sat, Jul 16, 2016 at 4:27 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> 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.
I see, I was not aware that non-GNU ar is supported. I posted a patch
on gcc-patches that uses a configure check at
https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00991.html
>
> 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."