On Tue, Feb 7, 2012 at 9:27 AM, Andi Kleen <a...@firstfloor.org> wrote:
> Richard Guenther <richard.guent...@gmail.com> writes:
>>
>> You then can do
>>
>>  gcc $OPTIONS -flto a.c -o a.o
>>  gcc $OPTIONS -flto b.c -o b.o
>>  gcc $OPTIONS -ffixed-r9 -ffixed-r10 -flto d.c -o d.o
>>  gcc $OPTIONS -ffixed-r9 -ffixed-r10 -flto e.c -o e.o
>>  gcc $OPTIONS -flto a.o b.o -o non-fixed-reg-part.o -r -nostdlib
>>  gcc $OPTIONS -flto -ffixed-r9 -ffixed-r10 d.o e.o -o fixed-reg-part.o
>> -r -nostdlib
>>  gcc non-fixed-reg-part.o fixed-reg-part.o
>>
>> thus, optimize both pieces via partial LTO linking (-r, maybe the -nostdlib 
>> is
>> not needed) and then do the final link separately.
>
> Note that ld -r with LTO has some problems in 4.6, it will work fully
> reliable.  This has been fixed in 4.7.

well he is not using ld directly so we go through the LTO path instead.

-- Pinski

Reply via email to