diff options
Diffstat (limited to 'meta/conf/distro/include/lto.inc')
-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 @@ +# 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 +LTO ?= "-flto" + +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" |