aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-13 16:07:45 -0400
committerMike Frysinger <vapier@gentoo.org>2012-05-13 16:07:45 -0400
commit66a072b474c4a5ec3e26920da258f87319c36fff (patch)
tree02fbeff90a6ca7035418e3fb485d35902260834f
parentgcc-config: make wrapping of programs dynamic (diff)
downloadgcc-config-66a072b474c4a5ec3e26920da258f87319c36fff.tar.gz
gcc-config-66a072b474c4a5ec3e26920da258f87319c36fff.tar.bz2
gcc-config-66a072b474c4a5ec3e26920da258f87319c36fff.zip
gcc-config: fix install of reference progsv1.7.1
The rework to make installation of helpers more automatic lost support for the binaries which gcc doesn't actually install -- namely, the cc and f77 helpers. Rework the code slightly onto the new framework to make adding these easier, and to make the existing ones work again. URL: http://bugs.gentoo.org/238984 Reported-by: Yuta SATOH <nigoro.gentoo@0x100.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xgcc-config21
-rw-r--r--tests/rw-multi-native-configs/test.select6
-rwxr-xr-xtests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.0/gcc0
-rwxr-xr-xtests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1/gcc0
-rwxr-xr-xtests/rw-multi-native-configs/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.2/gcc0
5 files changed, 17 insertions, 10 deletions
diff --git a/gcc-config b/gcc-config
index 6cfea7c..d81719b 100755
--- a/gcc-config
+++ b/gcc-config
@@ -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