From 586e30f7267fd284b89a0b4419dc5b97a40d3b0f Mon Sep 17 00:00:00 2001 From: Johannes Pfau Date: Fri, 3 Apr 2015 10:32:16 +0200 Subject: 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 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 -- cgit v0.10.2-6-g49f6