This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Avoid invoking ranlib on libbackend.a
On Fri, Jul 22, 2016 at 2:19 AM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Wed, Jul 20, 2016 at 7:11 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
>> On Wed, 20 Jul 2016, Bernd Schmidt wrote:
>>
>>> On 07/19/2016 10:20 AM, Richard Biener wrote:
>>> > I like it. Improving re-build time in my dev tree is very much
>>> > welcome, and yes,
>>> > libbackend build time is a big part of it usually (plus of course cc1
>>> > link time).
>>>
>>> Since that wasn't an entirely explicit ack, I'll add mine. Thank you for doing
>>> this.
>>>
>>>
>>> Bernd
>>>
>>>
>>
>> Committed as r238524 with the following minor change to the configure
>> test to use $CFLAGS and $LDFLAGS consistently:
>
> What is interesting is I did not see any change in my bootstrap/test
> times. Constant at 1 hour and 39 minutes (this includes archiving the
> build away).
> And yes I checked the logs to make sure T option to ar is being used too.
>
> Thanks,
> Andrew
Do you see any change in rebuild times in a --disable-bootstrap dev
tree? On average I guess you'd save about 20s per stage which is a
significant amount of time during development (in a
--disable-bootstrap tree) but not so much when bootstrap/regtesting.
The ar+ranlib invocation is primarily I/O bottlenecked (it writes out
900MB of stuff) so the amount of time saved by using a thin archive
depends on how slow your block device is.
>
>>
>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>> index 63052ba..241e82d 100644
>> --- a/gcc/configure.ac
>> +++ b/gcc/configure.ac
>> @@ -4905,7 +4905,7 @@ echo 'int main (void) { return 0; }' > conftest.c
>> if ($AR --version | sed 1q | grep "GNU ar" \
>> && $CC $CFLAGS -c conftest.c \
>> && $AR rcT conftest.a conftest.o \
>> - && $CC -o conftest conftest.a) >/dev/null 2>&1; then
>> + && $CC $CFLAGS $LDFLAGS -o conftest conftest.a) >/dev/null 2>&1; then
>> thin_archive_support=yes
>> fi
>> rm -f conftest.c conftest.o conftest.a conftest