From 9df7ab80895547a43857a299b58014dc359b6283 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 8 Nov 2020 16:02:07 -0800 Subject: 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 Signed-off-by: Richard Purdie --- meta/conf/distro/include/lto.inc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 meta/conf/distro/include/lto.inc (limited to 'meta/conf/distro/include') 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" -- cgit v1.2.3-54-g00ecf