diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2020-01-21 18:27:02 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-02 16:57:21 +0000 |
commit | 1c28cf571af169942c423e967b51913c5244d6c3 (patch) | |
tree | 3c34d95debf98d755b61ea23c055f77a7e2a287c /meta/recipes-devtools/gcc | |
parent | 843e4935b93b83349535e9f1d451826a36aa3c8b (diff) | |
download | poky-1c28cf571af169942c423e967b51913c5244d6c3.tar.gz |
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.
(From OE-Core rev: ef28e5a74d939acc98d6e8e9a0efbeb143b8025f)
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r-- | meta/recipes-devtools/gcc/libgcc.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc index e008d14f36..6d48ec9809 100644 --- a/meta/recipes-devtools/gcc/libgcc.inc +++ b/meta/recipes-devtools/gcc/libgcc.inc | |||
@@ -9,14 +9,18 @@ do_install_append_class-target () { | |||
9 | "linux-musleabi") extra_target_os="linux-gnueabi";; | 9 | "linux-musleabi") extra_target_os="linux-gnueabi";; |
10 | *) extra_target_os="linux";; | 10 | *) extra_target_os="linux";; |
11 | esac | 11 | esac |
12 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | 12 | if [ ! -e ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os ]; then |
13 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | ||
14 | fi | ||
13 | fi | 15 | fi |
14 | if [ -n "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" ]; then | 16 | if [ -n "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" ]; then |
15 | case "${TARGET_OS}" in | 17 | case "${TARGET_OS}" in |
16 | "linux-musleabi") extra_target_os="linux-musleabihf";; | 18 | "linux-musleabi") extra_target_os="linux-musleabihf";; |
17 | "linux-gnueabi") extra_target_os="linux-gnueabihf";; | 19 | "linux-gnueabi") extra_target_os="linux-gnueabihf";; |
18 | esac | 20 | esac |
19 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | 21 | if [ ! -e ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os ]; then |
22 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | ||
23 | fi | ||
20 | fi | 24 | fi |
21 | } | 25 | } |
22 | 26 | ||