diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-04-25 12:08:29 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-27 15:11:47 +0100 |
commit | fb21d2e147fb2d02f405ed67d30526e60a7d6857 (patch) | |
tree | 9c02802db387484ebf842026761f996aa1380be6 /meta | |
parent | dfc632785dd64a7d1c7a7029273c0dcd75bdde62 (diff) | |
download | poky-fb21d2e147fb2d02f405ed67d30526e60a7d6857.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
(From OE-Core rev: d6658505089234476c1b35fc08fef1eb4f121e85)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-cross.inc | 8 |
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" | |||
83 | 83 | ||
84 | # Compute how to get from libexecdir to bindir in python (easier than shell) | 84 | # Compute how to get from libexecdir to bindir in python (easier than shell) |
85 | BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}" | 85 | BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}" |
86 | # linker plugin path | ||
87 | LIBRELPATH = "${@os.path.relpath(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/bfd-plugins"))}" | ||
86 | 88 | ||
87 | do_install () { | 89 | do_install () { |
88 | ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h ) | 90 | ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h ) |
@@ -92,7 +94,7 @@ do_install () { | |||
92 | install -d ${D}${target_libdir} | 94 | install -d ${D}${target_libdir} |
93 | 95 | ||
94 | # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77 | 96 | # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77 |
95 | # gfortran is fully backwards compatible. This is a safe and practical solution. | 97 | # gfortran is fully backwards compatible. This is a safe and practical solution. |
96 | if [ -n "${@d.getVar('FORTRAN')}" ]; then | 98 | if [ -n "${@d.getVar('FORTRAN')}" ]; then |
97 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true | 99 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true |
98 | fortsymlinks="g77 gfortran" | 100 | fortsymlinks="g77 gfortran" |
@@ -118,6 +120,10 @@ do_install () { | |||
118 | cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | 120 | cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ |
119 | 121 | ||
120 | 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 | 122 | 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 |
123 | |||
124 | # install LTO linker plugins where binutils tools can find it | ||
125 | install -d ${D}${libdir}/bfd-plugins | ||
126 | ln -sf ${LIBRELPATH}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so | ||
121 | } | 127 | } |
122 | 128 | ||
123 | do_package[noexec] = "1" | 129 | do_package[noexec] = "1" |