summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-04-25 12:08:29 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-27 15:11:36 +0100
commitd6658505089234476c1b35fc08fef1eb4f121e85 (patch)
tree8db9cf1048d65047a6a51eda9fe99c44019b3e6a
parentd6ffd683bf635548e0bfb3fd6458ed03e26ec2bf (diff)
downloadopenembedded-core-contrib-d6658505089234476c1b35fc08fef1eb4f121e85.tar.gz
gcc-cross: Install linker LTO plugin for binutils tools
This will ensure that ar/ranlib/nm can load the lto linker plugin like gcc-ar, gcc-nm, gcc-ranlib does, this will let the behaviour match between gcc wrappers for these tools, this should help LTO builds for packages Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index e08807afad..dca4036ab5 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -83,6 +83,8 @@ INHIBIT_PACKAGE_STRIP = "1"
# Compute how to get from libexecdir to bindir in python (easier than shell)
BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+# linker plugin path
+LIBRELPATH = "${@os.path.relpath(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/bfd-plugins"))}"
do_install () {
( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h )
@@ -92,7 +94,7 @@ do_install () {
install -d ${D}${target_libdir}
# Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
- # gfortran is fully backwards compatible. This is a safe and practical solution.
+ # gfortran is fully backwards compatible. This is a safe and practical solution.
if [ -n "${@d.getVar('FORTRAN')}" ]; then
ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
fortsymlinks="g77 gfortran"
@@ -118,6 +120,10 @@ do_install () {
cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
+
+ # install LTO linker plugins where binutils tools can find it
+ install -d ${D}${libdir}/bfd-plugins
+ ln -sf ${LIBRELPATH}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so
}
do_package[noexec] = "1"