diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-11-08 16:02:10 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-11 10:08:11 +0000 |
commit | 352446a2ee119a774da077f0995f1c86498d019f (patch) | |
tree | 085079e8b6c6db7d857855bc1b6b8efc0d0186a4 /meta/conf/distro/include | |
parent | d20e270eccc8071a2ecf5f3f5274ce01a45d2f2a (diff) | |
download | poky-352446a2ee119a774da077f0995f1c86498d019f.tar.gz |
lto: Introduce LTOEXTRA variable
Certain packages may need additional flags to enable LTO, therefore
LTOEXTRA can be used to pass those flags
Add -flto-partition=none for alsa-lib
(From OE-Core rev: 0a5778f40f0d1a252f38151a1d4103fa7cbe7796)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/distro/include')
-rw-r--r-- | meta/conf/distro/include/lto.inc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/meta/conf/distro/include/lto.inc b/meta/conf/distro/include/lto.inc index d7fea26c64..eb36b892ca 100644 --- a/meta/conf/distro/include/lto.inc +++ b/meta/conf/distro/include/lto.inc | |||
@@ -18,6 +18,13 @@ LTO_pn-libcap = "" | |||
18 | LTO_pn-libproxy = "" | 18 | LTO_pn-libproxy = "" |
19 | LTO_pn-libbsd = "" | 19 | LTO_pn-libbsd = "" |
20 | 20 | ||
21 | # Custom LTO flags | ||
22 | # disable partitioning/streaming algorithm since its uses ASM | ||
23 | # constructs not compatible with lto | ||
24 | LTOEXTRA_pn-alsa-lib = "-flto-partition=none" | ||
25 | |||
26 | LTOEXTRA ?= "" | ||
27 | |||
21 | # Override it for additional or different options if needed e.g. | 28 | # Override it for additional or different options if needed e.g. |
22 | # with clang thin-lto might be better for compile speed | 29 | # with clang thin-lto might be better for compile speed |
23 | # | 30 | # |
@@ -29,9 +36,9 @@ LTO_pn-libbsd = "" | |||
29 | # -fuse-linker-plugin | 36 | # -fuse-linker-plugin |
30 | # ensures that libraries participate in LTO by supplying intermediate | 37 | # ensures that libraries participate in LTO by supplying intermediate |
31 | # code from .a files to linker | 38 | # code from .a files to linker |
32 | LTO ?= "-flto -ffat-lto-objects -fuse-linker-plugin " | 39 | LTO ?= "-flto -ffat-lto-objects -fuse-linker-plugin ${LTOEXTRA}" |
33 | 40 | ||
34 | SELECTED_OPTIMIZATION_append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" | 41 | SELECTED_OPTIMIZATION_append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" |
35 | TARGET_LDFLAGS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" | 42 | TARGET_LDFLAGS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" |
36 | 43 | ||
37 | SELECTED_OPTIMIZATION[vardeps] += "LTO" | 44 | SELECTED_OPTIMIZATION[vardeps] += "LTO LTOEXTRA" |