aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-08-24 18:36:57 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2018-08-24 19:09:17 +0100
commit9b907ef80bc421df23515afc4c306e4d96c67649 (patch)
tree2f3d5b775be75e931b3737e24d8793a372014f1d /tests/rw-multi-native-configs
parentREADME: document /etc/env.d/04gcc-${CTARGET} (diff)
downloadgcc-config-9b907ef80bc421df23515afc4c306e4d96c67649.tar.gz
gcc-config-9b907ef80bc421df23515afc4c306e4d96c67649.tar.bz2
gcc-config-9b907ef80bc421df23515afc4c306e4d96c67649.zip
Convert binary wrapper to a symlink wrapper.v2.0
Before the change: /usr/bin/gcc and friends were a copy of /usr/$(libexecdir)/misc/gcc-config After the change: /usr/bin/gcc is a symlink to a real compiler binary. Examples: /usr/${CTARGET}/gcc-bin/${GCC_VER}/gcc (native) /usr/${CHOST}/${CTARGET}/gcc-bin/${GCC_VER}/gcc (cross) gcc-config is a binary wrapper that does (or did) a few things: - [removed in 2011] injects additional CFLAGS_${ABI} Removed in commit 7ac40f3eb8434961f70485247d883f5b3009dcf2 "Stop auto appending CFLAGS_<abi> from the env." - traverses PATH for real compiler binary and reexecutes it. - reads /etc/env.d/05gcc-${CTARGET} as a fallback if PATH is empty. Today binary wrapper does only PATH resolution and re-execution. This change has a few minor benefits: - PATH will not contain explicit /usr/${CHOST}/${CTARGET}/gcc-bin/${GCC_VER} entry. This will make PATH shorter for those who have mavy cross-compilers installed. - compiler switch will not require sourcing '. /etc/profile' as changes are applied as soon an symlink is switched. - ccache will see gcc binary changes directly and react accordingly. Previously in default configuration ccache cache depended on state of /usr/$(libexecdir)/misc/gcc-config See bug #640958 where ccache did not notice USE=-pie -> USE=pie switch. - Reasoning about PATH ordering is straightforward: all available binaries (as symlinks) are in /usr/bin. See bug #255695 where PATH ordering changed and bug #626606 where people get confused on what is in /usr/bin/gcc binary. Bug: https://bugs.gentoo.org/626606 Bug: https://bugs.gentoo.org/255695 Bug: https://bugs.gentoo.org/640958 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'tests/rw-multi-native-configs')
-rw-r--r--tests/rw-multi-native-configs/test.select4
-rwxr-xr-xtests/rw-multi-native-configs/usr/lib/gcc-config/wrapper0
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/rw-multi-native-configs/test.select b/tests/rw-multi-native-configs/test.select
index c6d9daf..a9cc1d1 100644
--- a/tests/rw-multi-native-configs/test.select
+++ b/tests/rw-multi-native-configs/test.select
@@ -18,10 +18,10 @@ for (( i = 1; i < 4; ++i )) ; do
esac
for b in "${do_want[@]}" ; do
- [[ -e usr/bin/${b} ]] || exit 1
+ [[ -L usr/bin/${b} ]] || exit 1
done
for b in "${dont_want[@]}" ; do
- [[ -e usr/bin/${b} ]] && exit 1
+ [[ -L usr/bin/${b} ]] && exit 1
done
[[ -e etc/env.d/04gcc-${CHOST} ]] || exit 1
done
diff --git a/tests/rw-multi-native-configs/usr/lib/gcc-config/wrapper b/tests/rw-multi-native-configs/usr/lib/gcc-config/wrapper
deleted file mode 100755
index e69de29..0000000
--- a/tests/rw-multi-native-configs/usr/lib/gcc-config/wrapper
+++ /dev/null