From 1b57c6e4e2f96375711e0b826311e6c94e83d7f1 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Sun, 25 Nov 2007 05:39:33 +0000 Subject: [PATCH] Applying a patch from Tais M. Hansen to add initial sys-devel/icecream cluster compiler support for bug #200095. This is catalyst 2.0.5_pre6 for testing. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1263 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 36 +++++++++++++------ catalyst | 6 +++- files/catalyst.conf | 1 + modules/catalyst_support.py | 1 + modules/generic_stage_target.py | 5 +++ targets/embedded/embedded-preclean-chroot.sh | 5 +++ targets/grp/grp-preclean-chroot.sh | 5 +++ .../livecd-stage1-preclean-chroot.sh | 5 +++ targets/stage2/stage2-preclean-chroot.sh | 6 ++++ targets/stage3/stage3-preclean-chroot.sh | 6 ++++ targets/support/chroot-functions.sh | 26 ++++++++++++++ .../tinderbox/tinderbox-preclean-chroot.sh | 5 +++ 12 files changed, 95 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index de55ee24..dfbd1c40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,37 +1,51 @@ # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 25 Nov 2007; Chris Gianelloni catalyst, + files/catalyst.conf, modules/catalyst_support.py, + modules/generic_stage_target.py, + targets/embedded/embedded-preclean-chroot.sh, + targets/grp/grp-preclean-chroot.sh, + targets/livecd-stage1/livecd-stage1-preclean-chroot.sh, + targets/stage2/stage2-preclean-chroot.sh, + targets/stage3/stage3-preclean-chroot.sh, + targets/support/chroot-functions.sh, + targets/tinderbox/tinderbox-preclean-chroot.sh: + Applying a patch from Tais M. Hansen to add initial + sys-devel/icecream cluster compiler support for bug #200095. This is + catalyst 2.0.5_pre6 for testing. + 25 Nov 2007; Andrew Gaffney catalyst, files/catalyst.conf, modules/generic_stage_target.py: - add option for metadata_overlay use with portage + Add the option for using metadata_overlay with portage to speed up cache. 25 Nov 2007; Andrew Gaffney modules/stage1_target.py, modules/stage2_target.py, modules/stage3_target.py: - add /etc/portage to cleanables for stage 1-3 + Add /etc/portage to cleanables for stages 1 through 3. 17 Nov 2007; Andrew Gaffney livecd/files/livecd-local.start, targets/livecd-stage2/livecd-stage2-controller.sh, targets/support/livecdfs-update.sh: - we apparently still need profiles/eclass for building the stage3 from the - livecd + We apparently still need profiles/eclass for building the stage3 from the + livecd with the installer. 17 Nov 2007; Andrew Gaffney arch/mips.py: - apply patch for mips n32 support from Stuart Longland - in bug #197917 + Apply patch for MIPS N32 support from Stuart Longland + in bug #197917. 17 Nov 2007; Andrew Gaffney targets/livecd-stage2/livecd-stage2-controller.sh, targets/support/livecdfs-update.sh: - create symlink for /etc/gconf and /var/db when moving to /usr/livecd - remove preservation of eclasses/profiles - remove copying of livecd-local.start since it's not needed anymore + Create symlink for /etc/gconf and /var/db when moving to /usr/livecd, remove + preservation of eclasses/profiles, and remove copying of livecd-local.start + since it's not needed anymore. 16 Nov 2007; Andrew Gaffney targets/support/livecdfs-update.sh, targets/support/unmerge.sh: - move moving of /var/db back to livecdfs-update.sh but keep the symlink so we - can unmerge + Move moving of /var/db back to livecdfs-update.sh but keep the symlink so we + can unmerge. 13 Nov 2007; Chris Gianelloni catalyst, targets/support/livecdfs-update.sh, targets/support/unmerge.sh: diff --git a/catalyst b/catalyst index e5356955..1fb6c55c 100755 --- a/catalyst +++ b/catalyst @@ -9,7 +9,7 @@ import os,sys,imp,string,getopt import pdb __maintainer__="Chris Gianelloni " -__version__="2.0.5_pre5" +__version__="2.0.5_pre6" conf_values={} @@ -113,6 +113,10 @@ def parse_config(myconfig): print "Distcc support enabled." conf_values["DISTCC"]="1" + if "icecream" in string.split(conf_values["options"]): + print "Icecream compiler cluster support enabled." + conf_values["ICECREAM"]="1" + if "kerncache" in string.split(conf_values["options"]): print "Kernel cache support enabled." conf_values["KERNCACHE"]="1" diff --git a/files/catalyst.conf b/files/catalyst.conf index 909e0d7b..cf62c922 100644 --- a/files/catalyst.conf +++ b/files/catalyst.conf @@ -34,6 +34,7 @@ hash_function="crc32" # ccache = enables build time ccache support (highly recommended) # distcc = enable distcc support for building. You have to set distcc_hosts in # your spec file. +# icecream = enables icecream compiler cluster support for building # kerncache = keeps a tbz2 of your built kernel and modules (useful if your # build stops in livecd-stage2) # pkgcache = keeps a tbz2 of every built package (useful if your build stops diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index da40a5ac..a676fd19 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -154,6 +154,7 @@ valid_config_file_values.append("PKGCACHE") valid_config_file_values.append("KERNCACHE") valid_config_file_values.append("CCACHE") valid_config_file_values.append("DISTCC") +valid_config_file_values.append("ICECREAM") valid_config_file_values.append("ENVSCRIPT") valid_config_file_values.append("AUTORESUME") valid_config_file_values.append("FETCH") diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index f57443a9..1e99f243 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -202,6 +202,11 @@ class generic_stage_target(generic_target): # for the chroot: self.env["CCACHE_DIR"]="/var/tmp/ccache" + if self.settings.has_key("ICECREAM"): + self.mounts.append("/var/cache/icecream") + self.mountmap["/var/cache/icecream"]="/var/cache/icecream" + self.env["PATH"]="/usr/lib/icecc/bin:"+self.env["PATH"] + def override_cbuild(self): if self.makeconf.has_key("CBUILD"): self.settings["CBUILD"]=self.makeconf["CBUILD"] diff --git a/targets/embedded/embedded-preclean-chroot.sh b/targets/embedded/embedded-preclean-chroot.sh index b4da9cb2..608c9fd4 100755 --- a/targets/embedded/embedded-preclean-chroot.sh +++ b/targets/embedded/embedded-preclean-chroot.sh @@ -7,3 +7,8 @@ if [ -n "${clst_DISTCC}" ] then cleanup_distcc fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi diff --git a/targets/grp/grp-preclean-chroot.sh b/targets/grp/grp-preclean-chroot.sh index 94b5bedf..3cefd563 100755 --- a/targets/grp/grp-preclean-chroot.sh +++ b/targets/grp/grp-preclean-chroot.sh @@ -8,4 +8,9 @@ then cleanup_distcc fi +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi + gconftool-2 --shutdown diff --git a/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh b/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh index b4da9cb2..608c9fd4 100755 --- a/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh @@ -7,3 +7,8 @@ if [ -n "${clst_DISTCC}" ] then cleanup_distcc fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi diff --git a/targets/stage2/stage2-preclean-chroot.sh b/targets/stage2/stage2-preclean-chroot.sh index 9ad8aecf..f7813944 100755 --- a/targets/stage2/stage2-preclean-chroot.sh +++ b/targets/stage2/stage2-preclean-chroot.sh @@ -15,4 +15,10 @@ then cleanup_distcc fi +if [ -n "${clst_ICECREAM}" ] +then + run_emerge -C sys-devel/icecream || exit 1 + cleanup_icecream +fi + rm -f /var/log/emerge.log diff --git a/targets/stage3/stage3-preclean-chroot.sh b/targets/stage3/stage3-preclean-chroot.sh index 9ad8aecf..f7813944 100755 --- a/targets/stage3/stage3-preclean-chroot.sh +++ b/targets/stage3/stage3-preclean-chroot.sh @@ -15,4 +15,10 @@ then cleanup_distcc fi +if [ -n "${clst_ICECREAM}" ] +then + run_emerge -C sys-devel/icecream || exit 1 + cleanup_icecream +fi + rm -f /var/log/emerge.log diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index ee2097a3..6f80b9e7 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -99,6 +99,23 @@ setup_myfeatures(){ chmod a+x /usr/lib/distcc/bin/${CHOST}-wrapper for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done fi + + if [ -n "${clst_ICECREAM}" ] + then + clst_root_path=/ run_emerge --oneshot --nodeps sys-devel/icecream || exit 1 + + # This sets up automatic cross-icecc-fu according to + # http://gentoo-wiki.com/HOWTO_Setup_An_ICECREAM_Compile_Cluster#Icecream_and_cross-compiling + CHOST=$(portageq envvar CHOST) + LIBDIR=$(get_libdir) + cd /usr/${LIBDIR}/icecc/bin + rm cc gcc g++ c++ 2>/dev/null + echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/icecc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper + chmod a+x ${CHOST}-wrapper + for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done + export PATH="/usr/lib/icecc/bin:${PATH}" + export PREROOTPATH="/usr/lib/icecc/bin" + fi } setup_myemergeopts(){ @@ -166,6 +183,15 @@ cleanup_distcc() { rm /usr/lib/distcc/bin/*-wrapper } +cleanup_icecream() { + LIBDIR=$(get_libdir) + for i in cc gcc c++ g++; do + rm /usr/${LIBDIR}/icecc/bin/${i} + ln -s /usr/bin/icecc /usr/${LIBDIR}/icecc/bin/${i} + done + rm /usr/${LIBDIR}/icecc/bin/*-wrapper +} + update_env_settings(){ /usr/sbin/env-update source /etc/profile diff --git a/targets/tinderbox/tinderbox-preclean-chroot.sh b/targets/tinderbox/tinderbox-preclean-chroot.sh index b4da9cb2..608c9fd4 100755 --- a/targets/tinderbox/tinderbox-preclean-chroot.sh +++ b/targets/tinderbox/tinderbox-preclean-chroot.sh @@ -7,3 +7,8 @@ if [ -n "${clst_DISTCC}" ] then cleanup_distcc fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi -- 2.26.2