* [PATCH v5] lto: Introduce LTOEXTRA variable
@ 2020-11-07 22:31 Khem Raj
0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2020-11-07 22:31 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Certain packages may need additional flags to enable LTO, therefore
LTOEXTRA can be used to pass those flags
Add -flto-partition=none for alsa-lib
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v5: Fix typo s/alsa-libs/alsa-lib
meta/conf/distro/include/lto.inc | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/meta/conf/distro/include/lto.inc b/meta/conf/distro/include/lto.inc
index d7fea26c64..eb36b892ca 100644
--- a/meta/conf/distro/include/lto.inc
+++ b/meta/conf/distro/include/lto.inc
@@ -18,6 +18,13 @@ LTO_pn-libcap = ""
LTO_pn-libproxy = ""
LTO_pn-libbsd = ""
+# Custom LTO flags
+# disable partitioning/streaming algorithm since its uses ASM
+# constructs not compatible with lto
+LTOEXTRA_pn-alsa-lib = "-flto-partition=none"
+
+LTOEXTRA ?= ""
+
# Override it for additional or different options if needed e.g.
# with clang thin-lto might be better for compile speed
#
@@ -29,9 +36,9 @@ LTO_pn-libbsd = ""
# -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 "
+LTO ?= "-flto -ffat-lto-objects -fuse-linker-plugin ${LTOEXTRA}"
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"
+SELECTED_OPTIMIZATION[vardeps] += "LTO LTOEXTRA"
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-07 22:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-07 22:31 [PATCH v5] lto: Introduce LTOEXTRA variable Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox