diff options
| -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" | ||
