Gentoo Archives: gentoo-dev

From: Ryan Hill <rhill@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: LTO use in the tree
Date: Mon, 21 Apr 2014 04:03:16
Message-Id: 20140420220240.7f64774a@caribou.gateway.pace.com
In Reply to: [gentoo-dev] LTO use in the tree by Ryan Hill
1 On Sun, 20 Apr 2014 21:14:51 -0600
2 Ryan Hill <rhill@g.o> wrote:
3
4 > Hey all,
5 >
6 > As more and more packages are starting to add LTO flags automatically through
7 > their build systems, I thought I'd point out a couple things:
8 >
9 > - LTO utterly destroys debug info. Flags like -g are incompatible with LTO.
10 >
11 > - LTO causes .GCC.command.line sections to be discarded, which means your
12 > package will always be QA flagged as ignoring CFLAGS.
13 >
14 > - LTO takes a _lot_ of memory. That memory is required on the host arch.
15 > Distcc doesn't help things here, because linking happens locally. Consider
16 > all the archs your package is built on, and if they all routinely have
17 > multiple GBs of memory installed.
18 >
19 > - LTO in 4.7 is still fairly buggy. There are no plans to fix it. 4.8 is
20 > better, but 4.9 moves to a different model, so bugs in 4.8 probably won't be
21 > fixed, especially regarding memory usage.
22 >
23 > - I'm happy to backport patches to fix LTO problems if they're available, but
24 > you'll generally have to do the legwork. And like I said, most aren't going
25 > to be backportable.
26 >
27 > Please take these things into consideration when deciding whether or not this
28 > feature is worth it.
29 >
30 > Thanks.
31 >
32 >
33
34 One thing I forgot to mention - LTO can also have detrimental effect on certain
35 architectures. On some (eg. ppc), performance can actually be degraded due to
36 increased register pressure. On others like alpha it's questionable if it'll
37 even work at all...
38
39
40 --
41 Ryan Hill psn: dirtyepic_sk
42 gcc-porting/toolchain/wxwidgets @ gentoo.org
43
44 47C3 6D62 4864 0E49 8E9E 7F92 ED38 BD49 957A 8463

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-dev] Re: LTO use in the tree Martin Vaeth <martin@×××××.de>
Re: [gentoo-dev] Re: LTO use in the tree Matt Turner <mattst88@g.o>