diff options
author | Johannes Pfau <johannespfau@gmail.com> | 2015-04-03 10:32:16 +0200 |
---|---|---|
committer | Johannes Pfau <johannespfau@gmail.com> | 2015-04-07 20:14:26 +0200 |
commit | 586e30f7267fd284b89a0b4419dc5b97a40d3b0f (patch) | |
tree | c14ccd6b1106fdb4046b9ed756263ee2e1bd7af0 /scripts/build/cc | |
parent | d74f1cc2561bf6ae6b0f21743402415408087654 (diff) | |
download | crosstool-ng-586e30f7267fd284b89a0b4419dc5b97a40d3b0f.tar.gz crosstool-ng-586e30f7267fd284b89a0b4419dc5b97a40d3b0f.tar.bz2 crosstool-ng-586e30f7267fd284b89a0b4419dc5b97a40d3b0f.zip |
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.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 500c9e73..835aea06 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 |