What we need for building a multilib system is gcc and glib able to compile 32-bit executables, but to compile those apps in this configuration we need gcc and glib able to compile 32-bit executables. Because of this recursion, a simple changing of the profile and recompiling will not work. However, we can use an another gentoo installation to give the things a little push.
Login as root, and obtain the most recent stage3 tarball (wget it from the favorite mirror). Next type few commands, that will set up an environment to which you will later chroot:
Code: Select all
mkdir /helper
tar -xapf stage3-amd64-*.tar.bz2 -C /helper
mkdir /helper/usr/portage
mount --bind /usr/portage /helper/usr/portage
mount --bind /dev /helper/dev
mount -t proc none /helper/proc
mkdir /helper/target
mount --bind / /helper/target
Code: Select all
eselect profile list
eselect profile set [number_of_selected_profile]
Back to chrooting
Code: Select all
chroot /helper
mount -t devpts devpts /dev/pts
If you use stable branch type:
Code: Select all
emerge --root=/target --root-deps=rdeps gcc glibc
Code: Select all
ACCPET_KEYWORDS="~amd64" emerge --root=/target --root-deps=rdeps gcc glibc
Although the described process will not provide you with a complete multilib system, the rest of needed steps (e.g. emerging libraries) can be made from the main system, since the basic tools are available from this point.*
The clean up code is
Code: Select all
umount /helper/dev/pts /helper/dev /helper/proc /helper/usr/portage /helper/target
rm -R --one-file-system /helper
unlink stage3-amd64-*.tar.bz2
*-in order to compile virtualbox-ose I needed also emul-linux-x86-baselibs and emul-linux-x86-xlibs





