summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-07-11 07:05:46 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-17 14:01:38 +0100
commit1131e79540e1ba5d8562b13810f073e2e2efa7dc (patch)
treee833c513ce4a79f64f07e6834fcb42b7466a9a1c /meta
parent8e7d868f039d18dc7b27263fc401ac0b6084ca4e (diff)
downloadpoky-1131e79540e1ba5d8562b13810f073e2e2efa7dc.tar.gz
gcc-cross: Fix linker and fortran symlinks
If we used -fuse-ld gcc option, then it does not work ending in collect2: fatal error: cannot find 'ld' compilation terminated. This is because we are not creating proper symlinks for BFD and Gold linker in gcc installation Secondly, we end up with dangling fortran compiler symlinks if fortran is not enabled when confguring gcc, therefore create these symlinks only when fortran support is enabled in gcc (From OE-Core rev: f84614c082406287e608860741a82edd2f3c9bca) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index b08bc197ba..1e184a60db 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -161,17 +161,19 @@ do_install () {
161 161
162 install -d ${D}${target_base_libdir} 162 install -d ${D}${target_base_libdir}
163 install -d ${D}${target_libdir} 163 install -d ${D}${target_libdir}
164 164
165 # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77 165 # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
166 # gfortran is fully backwards compatible. This is a safe and practical solution. 166 # gfortran is fully backwards compatible. This is a safe and practical solution.
167 ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true 167 if [ -n "${@d.getVar('FORTRAN')}" ]; then
168 ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
169 fortsymlinks="g77 gfortran"
170 fi
168 171
169
170 # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are 172 # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
171 # found. These need to be relative paths so they work in different locations. 173 # found. These need to be relative paths so they work in different locations.
172 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ 174 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
173 install -d $dest 175 install -d $dest
174 for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do 176 for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip gcc cpp $fortsymlinks; do
175 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t 177 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
176 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t 178 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
177 done 179 done