summaryrefslogtreecommitdiff
path: root/scripts/build/cc
diff options
context:
space:
mode:
authorJohannes Pfau <johannespfau@gmail.com>2015-04-03 08:32:16 (GMT)
committerJohannes Pfau <johannespfau@gmail.com>2015-04-07 18:14:26 (GMT)
commit586e30f7267fd284b89a0b4419dc5b97a40d3b0f (patch)
treec14ccd6b1106fdb4046b9ed756263ee2e1bd7af0 /scripts/build/cc
parentd74f1cc2561bf6ae6b0f21743402415408087654 (diff)
Only create ${CT_TARGET}-cc${ext} symlink if ${CT_TARGET}-gcc exists
Without this canadion cross builds create invalid symlinks: When the code in do_cc_core_backend is called there is no ${CT_TARGET}-gcc in the install directory. Therefore ext is empty and we create a link to ${CT_TARGET}-gcc. The final compiler step then installs ${CT_TARGET}-gcc.exe and creates a working ${CT_TARGET}-cc.exe symlink but we still keep the invalid link as well. Signed-off-by: Johannes Pfau <johannespfau@gmail.com>
Diffstat (limited to 'scripts/build/cc')
-rw-r--r--scripts/build/cc/gcc.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 500c9e7..835aea0 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -492,7 +492,9 @@ do_cc_core_backend() {
# check whether compiler has an extension
file="$( ls -1 "${prefix}/bin/${CT_TARGET}-gcc."* 2>/dev/null || true )"
[ -z "${file}" ] || ext=".${file##*.}"
- CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
+ if [ -f "${prefix}/bin/${CT_TARGET}-gcc${ext}" ]; then
+ CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}"
+ fi
if [ "${CT_MULTILIB}" = "y" ]; then
if [ "${CT_CANADIAN}" = "y" -a "${mode}" = "baremetal" \
@@ -884,7 +886,9 @@ do_cc_backend() {
# check whether compiler has an extension
file="$( ls -1 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc."* 2>/dev/null || true )"
[ -z "${file}" ] || ext=".${file##*.}"
- CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc${ext}"
+ if [ -f "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc${ext}" ]; then
+ CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc${ext}"
+ fi
if [ "${CT_MULTILIB}" = "y" ]; then
if [ "${CT_CANADIAN}" = "y" ]; then