<div dir="ltr">Shouldn&#39;t the symlink be created in ${D}${STAGING_DIR_NATIVE} as suggested in:<div><a href="http://lists.openembedded.org/pipermail/openembedded-core/2014-April/091480.html">http://lists.openembedded.org/pipermail/openembedded-core/2014-April/091480.html</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 11, 2017 at 3:05 PM, Khem Raj <span dir="ltr">&lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If we used -fuse-ld gcc option, then it does not work<br>
ending in<br>
<br>
collect2: fatal error: cannot find &#39;ld&#39;                                                                                                                                                                                                       compilation terminated.<br>
<br>
This is because we are not creating proper symlinks for BFD<br>
and Gold linker in gcc installation<br>
<br>
Secondly, we end up with dangling fortran compiler symlinks<br>
if fortran is not enabled when confguring gcc, therefore<br>
create these symlinks only when fortran support is enabled<br>
in gcc<br>
<br>
Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>
---<br>
 meta/recipes-devtools/gcc/gcc-<wbr>cross.inc | 10 ++++++----<br>
 1 file changed, 6 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/meta/recipes-devtools/gcc/<wbr>gcc-cross.inc b/meta/recipes-devtools/gcc/<wbr>gcc-cross.inc<br>
index b08bc197ba..1e184a60db 100644<br>
--- a/meta/recipes-devtools/gcc/<wbr>gcc-cross.inc<br>
+++ b/meta/recipes-devtools/gcc/<wbr>gcc-cross.inc<br>
@@ -161,17 +161,19 @@ do_install () {<br>
<br>
        install -d ${D}${target_base_libdir}<br>
        install -d ${D}${target_libdir}<br>
-<br>
+<br>
        # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77<br>
        # gfortran is fully backwards compatible. This is a safe and practical solution.<br>
-       ln -sf ${STAGING_DIR_NATIVE}${prefix_<wbr>native}/bin/${TARGET_PREFIX}<wbr>gfortran ${STAGING_DIR_NATIVE}${prefix_<wbr>native}/bin/${TARGET_PREFIX}<wbr>g77 || true<br>
+       if [ -n &quot;${@d.getVar(&#39;FORTRAN&#39;)}&quot; ]; then<br>
+               ln -sf ${STAGING_DIR_NATIVE}${prefix_<wbr>native}/bin/${TARGET_PREFIX}<wbr>gfortran ${STAGING_DIR_NATIVE}${prefix_<wbr>native}/bin/${TARGET_PREFIX}<wbr>g77 || true<br>
+               fortsymlinks=&quot;g77 gfortran&quot;<br>
+       fi<br>
<br>
-<br>
        # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are<br>
        # found. These need to be relative paths so they work in different locations.<br>
        dest=${D}${libexecdir}/gcc/${<wbr>TARGET_SYS}/${BINV}/<br>
        install -d $dest<br>
-       for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do<br>
+       for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip gcc cpp $fortsymlinks; do<br>
                ln -sf ${BINRELPATH}/${TARGET_PREFIX}<wbr>$t $dest$t<br>
                ln -sf ${BINRELPATH}/${TARGET_PREFIX}<wbr>$t ${dest}${TARGET_PREFIX}$t<br>
        done<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.2<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>