diff options
author | Alexey Neyman <stilor@att.net> | 2017-04-01 10:12:05 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-04-01 10:12:05 -0700 |
commit | d6bf8e2d9866c6c3618e5053aca01df7fe7d61d0 (patch) | |
tree | cd27410ed6cc009a730ffd59efc399c5002c32ca /scripts/build/binutils | |
parent | 88d28e6eed547e9992c44c6894764dd7b000b980 (diff) | |
download | crosstool-ng-d6bf8e2d9866c6c3618e5053aca01df7fe7d61d0.tar.gz crosstool-ng-d6bf8e2d9866c6c3618e5053aca01df7fe7d61d0.tar.bz2 crosstool-ng-d6bf8e2d9866c6c3618e5053aca01df7fe7d61d0.zip |
Fix symlinking to multiarch tools on Cygwin
On cygwin, creating both "foo.exe" and "foo" results in 'ln -sf'
returning an error ("File exists"). However, ln silently removes
the "foo.exe" in this case, so an attempt to re-run the same command
manually then succeeds.
Hence, make binutils.sh also create symlinks with .exe prefix,
using the new & shiny routine.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/binutils')
-rw-r--r-- | scripts/build/binutils/binutils.sh | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index f9c5fe76..2f3f3a53 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -82,7 +82,6 @@ do_binutils_for_build() { # Build binutils for host -> target do_binutils_for_host() { - local -a binutils_tools local -a binutils_opts CT_DoStep INFO "Installing binutils for host" @@ -118,26 +117,13 @@ do_binutils_for_host() { # are not executable on the build machine. case "${CT_TOOLCHAIN_TYPE}" in cross|native) - binutils_tools=( ar as ld ranlib strip ) - if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then - binutils_tools+=( elf2flt flthdr ) - fi - case "${CT_BINUTILS_LINKERS_LIST}" in - ld) binutils_tools+=( ld.bfd ) ;; - gold) binutils_tools+=( ld.gold ) ;; - ld,gold) binutils_tools+=( ld.bfd ld.gold ) ;; - gold,ld) binutils_tools+=( ld.bfd ld.gold ) ;; - esac - mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin" mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin" - for t in "${binutils_tools[@]}"; do - CT_DoExecLog ALL ln -sv \ - "${CT_PREFIX_DIR}/${CT_TARGET}/bin/${t}" \ - "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin/${t}" - CT_DoExecLog ALL ln -sv \ - "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" \ - "${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${t}" - done + CT_SymlinkTools "${CT_BUILDTOOLS_PREFIX_DIR}/bin" \ + "${CT_PREFIX_DIR}/bin" \ + "${CT_TARGET}" + CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}" + CT_DoExecLog ALL ln -sv "${CT_PREFIX_DIR}/${CT_TARGET}/bin" \ + "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin" ;; *) ;; esac |