[Libreoffice] [GSoC] link-time optimization

Matúš Kukan matus.kukan at gmail.com
Sat Aug 20 14:04:22 PDT 2011


Hello,

I created patch, which allows link-time optimization (--enable-lto)
for shared libraries, you need at least gcc-4.5 (I'm not checking for
version in configure).
gcc-4.5 is not really good for lto but I was able to install
LibreOffice with lto enabled. I don't know what should I try to test
if it is really faster and how much.
Building is slower because gcc is compiling sources twice ? or
something like that. But real problem is that lto is memory expensive.
We could gain more with bigger libraries but it's not possible with
gcc-4.5, I'm afraid.
Unfortunately I was not able to install gcc-4.6, so I don't know if
it's better but it should.

You can use gold as linker for elf libraries, it's really faster but
linking phase it's not that much.
Most of the time is running lto1 executable and it eat cca 2GB RAM
when optimizing sw library. (cca 4,5 minutes for me)

So it is possible but not in parallel. And not for really big libraries.
I am hoping it will be much better with gcc-4.6.

ok to push ? For sure there could be better message at least in configure.

Best regards,

Matúš
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-enable-using-link-time-optimization.patch
Type: text/x-patch
Size: 5561 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110820/37d8ecd8/attachment.bin>


More information about the LibreOffice mailing list