Sometimes you have a Gentoo system with a nomultilib profile and you need to switch profile to multilib.
This operation is really difficult, more than it seems, because you need to compile 32bit software, i.e. you need a 32bit compiler. But to have a 32bit compiler you need to compile it, etc.. This is the Chicken-and-egg problem.
There are two way to perform the migration:
- First of all, switch the profile to multilib (with
eselect
). Then, create a chroot environment with a multilib stage3 and compile the basic 32bit compiling toolchain; then pack those tools/libs, exit from chroot and install those binaries. Now you have the 32bit toolchain available and consider your system as multilib ready. - Install an already available 32bit toolchain with precompiled binaries directly in your system.
Imho method (1) is unnecessarily complicated. I suggest you to use method (2).
It's described here:
- Install binaries for 32bit toolchain:
# PORTAGE_BINHOST="http://packages.gentooexperimental.org/packages/amd64-stable/" emerge -avG gcc glibc binutils libtool
- Select the compiler:
# gcc-config 1 # Replace 1 with the compiler you want.
# source /etc/profile # Or open a new shell (maybe it's better).
- Reinstall the 32bit toolchain (source-based):
# emerge glibc libtool binutils coreutils
# emerge gcc
- Re-emerge system:
# emerge -e system