Gentoo Wiki ArchivesGentoo Wiki

HOWTO_change_CHOST_relatively_safely

This article is still a Stub. You can help Gentoo-Wiki by expanding it.


Please improve it in any way that you see fit, and remove this notice {{Cleanup}} from the article. For tips on cleaning and formatting see Cleanup process


Note: Changing your CHOST is a step that is rarely if ever a good idea. In many cases it should not be expected to work. However, there are some cases, such as upgrading from i386 to i686, where a CHOST change is an unfortunate necessity.


Although the official CHOST change guide will work in many cases, apparently there are some cases where your system will bork itself. The following steps are a little more specific and should be safe in even more cases.


Note: Make sure your system is up to date. For instance, trying to jump from gcc-3.3 to gcc-4.1.2 _and_ changing your chost at the same time will probably cause some major issues. If you're having issues with glibc or some other system package not emerging, mask the update. You can unmask it after everything's fixed. Although this process might work anyways, its probably better to be safe than sorry


1. Change your CHOST. Edit /etc/make.conf and update the CHOST definition

2. Clear your ccache, if relevant

# ccache -C

3. Emerge gcc to get a gcc install for the new CHOST

# emerge gcc

4. Update the selected version gcc

# gcc-config -l
# gcc-config (the version with the new chost)

5. Fix libtool files

# fix_libtool_files.sh (on any older versions of gcc)
# fix_libtool_files.sh (same again with --oldarch {your_old_arch})
# fix_libtool_files.sh (on current version of gcc)
# fix_libtool_files.sh (on current version with --oldarch {your_old_arch})

6. Update the local environment

# env-update && source /etc/profile

7. Emerge binutils to get a binutils install for the new CHOST

# emerge binutils

8. Update the selected version of binutils

# binutils-config -l
# binutils-config (the version with the new chost)
Note: (at this point I had to re-emerge coreutils, otherwise the 'id' command doesn't return usernames anymore, which makes installing other apps (like 'man') impossible. <basic>)


9. Re-emerge a bunch of important packages. Note, apr and apache can be left off this list if you do not use them. But if you do, it is important that they are re-emerged now.

# emerge --oneshot binutils-config gnuconfig m4 bison libintl gcc-config autoconf autoconf-wrapper automake pkgconfig make flex gdb patch glibc apr apache

10. Update the local environment again

# env-update && source /etc/profile

11. Re-emerge perl and python and all related ebuilds

# emerge -e perl python

12. Re-emerge libtool.

# emerge --oneshot libtool

13. Run perl-cleaner to fix any modules.

# perl-cleaner reallyall 

14. Fix up stdc++ libraries and anything that depends on them.

# emerge libstdc++-v3
# revdep-rebuild --library libstdc++.so.5
# revdep-rebuild --library libstdc++.so.6
Retrieved from "http://www.gentoo-wiki.info/HOWTO_change_CHOST_relatively_safely"

Last modified: Wed, 10 Sep 2008 16:18:00 +1000 Hits: 12,351

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.