summaryrefslogtreecommitdiffstats
path: root/meta/conf/distro/include/lto.inc
blob: d7fea26c642ced6e49341b66921c20dbb2b3589c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# To enable LTO, add following in local.conf
# require conf/distro/include/lto.inc
# DISTRO_FEATURES_append = " lto"
#

# Disable LTO for following packages
LTO_pn-glibc = ""
LTO_pn-gcc-runtime = ""
LTO_pn-libgcc-initial = ""
LTO_pn-libgcc = ""
LTO_pn-libpam = ""
LTO_pn-elfutils = ""
LTO_pn-perl = ""
LTO_pn-busybox = ""
LTO_pn-libxcrypt = ""
LTO_pn-curl = ""
LTO_pn-libcap = ""
LTO_pn-libproxy = ""
LTO_pn-libbsd = ""

# Override it for additional or different options if needed e.g.
# with clang thin-lto might be better for compile speed
#
# ffat-lto-objects
# object files that contain both the intermediate
# language and the object code. This makes them
# usable for both LTO linking and normal linking
#
# -fuse-linker-plugin
# ensures that libraries participate in LTO by supplying intermediate
# code from .a files to linker
LTO ?= "-flto -ffat-lto-objects -fuse-linker-plugin "

SELECTED_OPTIMIZATION_append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}"
TARGET_LDFLAGS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}"

SELECTED_OPTIMIZATION[vardeps] += "LTO"