diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-11-08 16:02:07 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-11 10:08:11 +0000 |
commit | 9df7ab80895547a43857a299b58014dc359b6283 (patch) | |
tree | 5464e25b244bb9febda0720d61c1e8ed76582ad1 /meta/conf | |
parent | f075071761172c69f8ae2be5868d51ef9ef646e7 (diff) | |
download | poky-9df7ab80895547a43857a299b58014dc359b6283.tar.gz |
lto: Add global LTO distro policy file
Distros which want to enable LTO can utilize this file, it only covers
packages from OE-Core, other layers should include there own exclusion
list for recipe which dont work with LTO
Document the needed changes in local.conf.extended
(From OE-Core rev: 228b5a91516cdf9d5a1df3c721ba8e5619b188ab)
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.inc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/conf/distro/include/lto.inc b/meta/conf/distro/include/lto.inc new file mode 100644 index 0000000000..fe0f6c9f44 --- /dev/null +++ b/meta/conf/distro/include/lto.inc | |||
@@ -0,0 +1,28 @@ | |||
1 | # To enable LTO, add following in local.conf | ||
2 | # require conf/distro/include/lto.inc | ||
3 | # DISTRO_FEATURES_append = " lto" | ||
4 | # | ||
5 | |||
6 | # Disable LTO for following packages | ||
7 | LTO_pn-glibc = "" | ||
8 | LTO_pn-gcc-runtime = "" | ||
9 | LTO_pn-libgcc-initial = "" | ||
10 | LTO_pn-libgcc = "" | ||
11 | LTO_pn-libpam = "" | ||
12 | LTO_pn-elfutils = "" | ||
13 | LTO_pn-perl = "" | ||
14 | LTO_pn-busybox = "" | ||
15 | LTO_pn-libxcrypt = "" | ||
16 | LTO_pn-curl = "" | ||
17 | LTO_pn-libcap = "" | ||
18 | LTO_pn-libproxy = "" | ||
19 | LTO_pn-libbsd = "" | ||
20 | |||
21 | # Override it for additional or different options if needed e.g. | ||
22 | # with clang thin-lto might be better for compile speed | ||
23 | LTO ?= "-flto" | ||
24 | |||
25 | SELECTED_OPTIMIZATION_append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" | ||
26 | TARGET_LDFLAGS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}" | ||
27 | |||
28 | SELECTED_OPTIMIZATION[vardeps] += "LTO" | ||