| e8555c89 Andy McCall | 1 | # This flavour enables link-time optimization (LTO). |
| 2 | # This requires GCC 4.5 or higher; it's known to work on GCC 4.6.3. |
|
| 3 | ||
| 4 | include build/flavour-opt.mk |
|
| 5 | ||
| 6 | # Enable LTO for compiling and linking. |
|
| 7 | # Don't bother with native code output in the compile phase, since new code |
|
| 8 | # will be generated in the link phase. |
|
| 9 | # Ideally LTO would be enabled for the 3rdparty libs as well, but I haven't |
|
| 10 | # been able to make that work. |
|
| 11 | COMPILE_FLAGS+=-flto |
|
| 12 | LINK_FLAGS+=-flto=jobserver |
|
| 13 | ||
| 14 | # Enable this line to speed up compilation. This is supported from gcc-4.7 |
|
| 15 | # onward. Quote from the gcc manual: |
|
| 16 | # -fno-fat-lto-objects improves compilation time over plain LTO, but |
|
| 17 | # requires the complete toolchain to be aware of LTO. It requires a |
|
| 18 | # linker with linker plugin support for basic functionality. |
|
| 19 | #COMPILE_FLAGS+=-fno-fat-lto-objects |