This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: lto pseudo-object files and fixed registers
Richard Guenther <richard.guenther@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.
-Andi
--
ak@linux.intel.com -- Speaking for myself only