]> code.ossystems Code Review - openembedded-core.git/commitdiff
lto.inc: Add -ffat-lto-objects and -fuse-linker-plugin
authorKhem Raj <raj.khem@gmail.com>
Mon, 9 Nov 2020 00:02:09 +0000 (16:02 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Nov 2020 10:04:34 +0000 (10:04 +0000)
This helps to improve LTO and ensure the libs can be linked with non-LTO
objects too

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/lto.inc

index fe0f6c9f448b8d82b301abc2f1ce75ce5aeedae0..d7fea26c642ced6e49341b66921c20dbb2b3589c 100644 (file)
@@ -20,7 +20,16 @@ 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"
+#
+# 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)}"