diff options
5 files changed, 17 insertions, 10 deletions
@@ -228,22 +228,25 @@ update_wrappers() { # For all toolchains, we want to create the fully qualified # `tuple-foo`. Only native ones do we want the simple `foo`. local all_wrappers=( ${new_wrappers[@]/#/${CTARGET}-} ) - is_cross_compiler || all_wrappers+=( "${new_wrappers[@]}" ) + if ! is_cross_compiler ; then + all_wrappers+=( "${new_wrappers[@]}" ) + # There are a few fun extra progs which we have to handle #412319 + all_wrappers+=( cc:gcc f77:g77 ) + fi # Then install wrappers for anything new to this profile. local ref for x in "${all_wrappers[@]}" ; do - # Only install a wrapper if the binary exists ... # We want to figure out the 'reference file' for each # wrapper (the binary we're 'wrapping') so that we can # sync mtimes together. This makes things like ccache # happy. See Bug #70548 for more info. - case ${x} in - cc) ref=gcc;; - f77) ref=g77;; - *) ref=${x};; - esac - ref="${ROOT}${GCC_PATH}/${ref}" + ref="${ROOT}${GCC_PATH}/${x#*:}" + if [[ ${x} == *:* ]] ; then + # Only install a wrapper if the reference binary exists ... + [[ -x ${ref} ]] || continue + fi + x=${x%:*} if [[ ! -x ${ref} ]] ; then if is_cross_compiler ; then ewarn "insanity with ${x} and ${ref}" @@ -253,6 +256,8 @@ update_wrappers() { ref="${ROOT}${GCC_PATH}/${x#${CTARGET}-}" fi fi + + # Now do the actual wrapper copy with paths to the reference binary if [[ -x ${ref} ]] ; then atomic_cp "${wrapper}" "${ROOT}usr/bin" "${x}" "${ref}" else diff --git a/tests/rw-multi-native-configs/test.select b/tests/rw-multi-native-configs/test.select index ffa6bbc..5912d2c 100644 --- a/tests/rw-multi-native-configs/test.select +++ b/tests/rw-multi-native-configs/test.select @@ -1,7 +1,9 @@ #!/bin/bash for (( i = 1; i < 4; ++i )) ; do - rm -f usr/bin/cpp + rm -f usr/bin/* gcc-config -C ${i} "$@" || exit 1 - [[ -e usr/bin/cpp ]] || exit 1 + for b in {,${CHOST}-}{cpp,gcc} cc ; do + [[ -e usr/bin/${b} ]] || exit 1 + done [[ -e etc/env.d/04gcc-${CHOST} ]] || exit 1 done diff --git a/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.0/gcc b/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.0/gcc new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.0/gcc diff --git a/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1/gcc b/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1/gcc new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1/gcc diff --git a/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.2/gcc b/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.2/gcc new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/tests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.2/gcc |