Barnoid’s Knowledge Base

Bits of Collected Wisdom

December 5th, 2006

Portage in a File

Here’s how to store portage in a file. Ext2/3 filesystems on a 2GB partition do not have enough inodes to store the , use reiserfs, for example.

/ # dd if=/dev/null of=/usr/portage.disk bs=1M count=0 seek=2048
/ # mkreiserfs -f /usr/portage.disk
/ # mkdir -p /usr/portage
/ # mount /usr/portage.disk /usr/portage -o loop,notail,noatime,nodev

The portage file is limited to 2GBs, hence we have to move the distfiles directory (default: /usr/portage/distfiles). This can be done either by editing make.conf and specify a new location or creating a distfiles directory somewhere else and have /usr/portage/distfiles link to it:

/ # mkdir -p /var/tmp/portage/distfiles
/ # cd /usr/portage
/usr/portage # ln -s /var/tmp/portage/distfiles

Finally, add a line to /etc/fstab to have the portage disk mounted at boot time:

/usr/portage.disk    /usr/portage    reiserfs    loop,notail,noatime,nodev,noexec 0 0

Done.

September 20th, 2006

GCC: Compilation of 4.1.1 fails with HARDENED 3.4.6

ok, so you finally do the GCC 4.1.1 update that is basically forced upon us and end up with:

# emerge -uv gcc
/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/limits:990: error: stray '\226' in program
/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/limits:1047: error: stray '\374' in program
/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/limits:1104: error: stray '\226' in program
...
!!! ERROR: sys-devel/gcc-4.1.1 failed.
Call stack:
ebuild.sh, line 1546:   Called dyn_compile
ebuild.sh, line 937:   Called src_compile
ebuild.sh, line 1255:   Called toolchain_src_compile
toolchain.eclass, line 24:   Called gcc_src_compile
toolchain.eclass, line 1534:   Called gcc_do_make
toolchain.eclass, line 1408:   Called die

!!! emake failed with profiledbootstrap
!!! If you need support, post the topmost build error, and the call stack if relevant.

It turns out that the “HARDENED” gcc 3.4.6 cannot compile gcc 4.1.1.

Solution: re-emerge the old gcc without the HARDENED flag

# emerge --oneshot =gcc-3.4.6-r1
# env-update && source /etc/profile

and then, finally

# emerge --auv gcc

Happy compiling!