From 211259aacd636e0e5171a560e912fa76c2db716e Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 8 Feb 2012 19:45:57 -0800 Subject: [PATCH] Changed the logic to discover the gcc atom from the config. The gcc-config file name could be different from the gcc atom that creates it. Changed the logic to first find out the binary path of gcc and then to query portage to see what package owns that path. BUG=none TEST=cros_sdk --bootstrap --replace cros_sdk -- ./setup_board --board=x86-zgb --nousepkg Change-Id: I3ccfa9948aaba6ba28107f150523c8a5d7cf1260 Reviewed-on: https://gerrit.chromium.org/gerrit/15556 Reviewed-by: David James Reviewed-by: Zdenek Behan Tested-by: asharif Reviewed-by: Mike Frysinger Commit-Ready: asharif --- sdk_lib/make_chroot.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 56f37e5cc8..384f8c1a70 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -422,11 +422,12 @@ early_enter_chroot emerge -uNv $USEPKG '>=sys-devel/gcc-4.4' sys-libs/glibc \ # HACK: Select the latest toolchain. We're assuming that when this is # ran, the chroot has no experimental versions of new toolchains, just # one that is very old, and one that was just emerged. +GCC_ATOM="$(early_enter_chroot portageq best_version / sys-devel/gcc)" +early_enter_chroot emerge --unmerge "<${GCC_ATOM}" CHOST="$(early_enter_chroot portageq envvar CHOST)" LATEST="$(early_enter_chroot gcc-config -l | grep "${CHOST}" | tail -n1 | \ cut -f3 -d' ')" early_enter_chroot gcc-config "${LATEST}" -early_enter_chroot emerge --unmerge "