[oe-commits] Robert Yang : gcc-cross: aviod creating invalid symlinks

git at git.openembedded.org git at git.openembedded.org
Wed Mar 14 13:21:03 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: 7893e74311e53882d8f93ecb95a6bd9f5b14651e
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7893e74311e53882d8f93ecb95a6bd9f5b14651e

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Wed Mar 14 17:13:21 2012 +0800

gcc-cross: aviod creating invalid symlinks

There are several invalid symlinks in gcc-cross-initial,
gcc-cross-intermediate and gcc-cross, these cause the error:(56 errors)

tmp/work/i586-poky-linux/gcc-cross-initial-4.6.3+svnr184847-r23/temp/log.do_populate_sysroot:
log.do_populate_sysroot:grep: /path/to/invalid/symlink: No such file or directory

Avoid creating invalid symlinks would fix this problem.

Use the:
[ ! -e file ] || do_something
But not use:
[ -e file ] && do_something
is because that if the "file" doesn't exist, then the whole statement
would return false, and bitbake treats this an error, so use the "||" to
let it always be true.

[YOCTO #2095]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../gcc/gcc-cross-intermediate.inc                 |    3 ++-
 meta/recipes-devtools/gcc/gcc-package-cross.inc    |    6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
index ea105e6..87d11ab 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
@@ -51,7 +51,8 @@ do_install () {
 	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
 	install -d $dest
 	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		[ ! -e ${BINRELPATH}/${TARGET_PREFIX}$t ] || \
+	        ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
 	done
 }
 
diff --git a/meta/recipes-devtools/gcc/gcc-package-cross.inc b/meta/recipes-devtools/gcc/gcc-package-cross.inc
index e32412c..3d52d23 100644
--- a/meta/recipes-devtools/gcc/gcc-package-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-package-cross.inc
@@ -19,8 +19,10 @@ do_install () {
 	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
 	install -d $dest
 	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+        if [ -e ${BINRELPATH}/${TARGET_PREFIX}$t ]; then
+		    ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		    ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+        fi
 	done
 
 	# Remove things we don't need but keep share/java





More information about the Openembedded-commits mailing list