summaryrefslogtreecommitdiffstats
path: root/meta/conf
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-11-08 16:02:09 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-11 10:08:11 +0000
commitd20e270eccc8071a2ecf5f3f5274ce01a45d2f2a (patch)
treee42f9c7c25c73553dd8fe725c44e08edebaaf943 /meta/conf
parent3487d920f6edb320d67bca62c8495daad4498926 (diff)
downloadpoky-d20e270eccc8071a2ecf5f3f5274ce01a45d2f2a.tar.gz
lto.inc: Add -ffat-lto-objects and -fuse-linker-plugin
This helps to improve LTO and ensure the libs can be linked with non-LTO objects too (From OE-Core rev: 770c69c51f87223eee7bd968fd28a5dc15a955d6) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf')
-rw-r--r--meta/conf/distro/include/lto.inc11
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/conf/distro/include/lto.inc b/meta/conf/distro/include/lto.inc
index fe0f6c9f44..d7fea26c64 100644
--- a/meta/conf/distro/include/lto.inc
+++ b/meta/conf/distro/include/lto.inc
@@ -20,7 +20,16 @@ LTO_pn-libbsd = ""
20 20
21# Override it for additional or different options if needed e.g. 21# Override it for additional or different options if needed e.g.
22# with clang thin-lto might be better for compile speed 22# with clang thin-lto might be better for compile speed
23LTO ?= "-flto" 23#
24# ffat-lto-objects
25# object files that contain both the intermediate
26# language and the object code. This makes them
27# usable for both LTO linking and normal linking
28#
29# -fuse-linker-plugin
30# ensures that libraries participate in LTO by supplying intermediate
31# code from .a files to linker
32LTO ?= "-flto -ffat-lto-objects -fuse-linker-plugin "
24 33
25SELECTED_OPTIMIZATION_append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" 34SELECTED_OPTIMIZATION_append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}"
26TARGET_LDFLAGS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" 35TARGET_LDFLAGS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}"