[oe-commits] [openembedded-core] 14/24: libgcc.inc: Fix an issue w/ a recursive symlink
git at git.openembedded.org
git at git.openembedded.org
Sun Feb 2 16:53:43 UTC 2020
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit ec2879eca51d3fdb11eba6f50ff00bef1d1a1494
Author: Mark Hatle <mark.hatle at xilinx.com>
AuthorDate: Tue Jan 21 18:27:02 2020 -0600
libgcc.inc: Fix an issue w/ a recursive symlink
If the OS is not Linux, the code could end up generating a recursive symlink.
This can happen because the same symlink can be created twice in a row. If this
happenes, the second symlink becomes a link to itself within the directory
pointed to by the original link.
In order to prevent this, verify that the destination does not already exist.
Signed-off-by: Mark Hatle <mark.hatle at xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle at kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-devtools/gcc/libgcc.inc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index e008d14..6d48ec9 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -9,14 +9,18 @@ do_install_append_class-target () {
"linux-musleabi") extra_target_os="linux-gnueabi";;
*) extra_target_os="linux";;
esac
- ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
+ if [ ! -e ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os ]; then
+ ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
+ fi
fi
if [ -n "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" ]; then
case "${TARGET_OS}" in
"linux-musleabi") extra_target_os="linux-musleabihf";;
"linux-gnueabi") extra_target_os="linux-gnueabihf";;
esac
- ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
+ if [ ! -e ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os ]; then
+ ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
+ fi
fi
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list