From 2a082de1501cccec4245d0c59b5f7b97516708d7 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 9 Jul 2013 16:23:02 -0400 Subject: [PATCH] feat(bootstrap_sdk): Build cross toolchains Until now we haven't built our own cross toolchains and used old packages from Google. It is time to break free and move on! --- lib/catalyst_sdk_stage4.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/catalyst_sdk_stage4.sh b/lib/catalyst_sdk_stage4.sh index e2b540a6d2..4d264498b4 100644 --- a/lib/catalyst_sdk_stage4.sh +++ b/lib/catalyst_sdk_stage4.sh @@ -2,5 +2,35 @@ source /tmp/chroot-functions.sh +# Build cross toolchains +# crossdev only does full bootstraps so if all of the packages are already +# installed (i.e. we are updating an existing stage4) then use emerge +for cross_chost in x86_64-cros-linux-gnu; do + echo "Installing toolchain for ${cross_chost}" + cross_pkgs=( cross-${cross_chost}/{binutils,gcc,gdb,glibc,linux-headers} ) + cross_bootstrap=0 + for pkg in "${cross_pkgs[@]}"; do + if ! portageq match / "$pkg" | grep .; then + cross_bootstrap=1 + break + fi + done + + if [[ "${cross_bootstrap}" -eq 1 ]]; then + crossdev --ov-output "/usr/local/portage/crossdev" \ + --portage "${clst_myemergeopts}" \ + --env 'FEATURES=splitdebug' \ + --stable --ex-gdb --stage4 \ + --target "${cross_chost}" || exit 1 + else + # Still run --init-target to ensure config is correct + crossdev --ov-output "/usr/local/portage/crossdev" \ + --env 'FEATURES=splitdebug' \ + --stable --ex-gdb --init-target \ + --target "${cross_chost}" || exit 1 + run_merge -u "${cross_pkgs[@]}" + fi +done + echo "Double checking everything is fresh and happy." run_merge -uDN --with-bdeps=y world