(6) Install Base System - (Stage 3 tarball)
We down load a tarball containing the pre-compiled base system from a Gentoo Mirror onto the USB Hardrive, and extract it. I got my copy from https://www.mirrorservice.org/sites/distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/.
Choose Generic ARMv7 OR Optimised Stage-3
Both Stage-3 are suitable for Raspberry Pi 2 and the new Raspberry Pi 3.
The file we are looking for is the release of arm autobuild called stage3-armv7a_hardfp-YYYYMMDD.tar.bz2. This is for Raspberry Pi 2, which has the Quad Core ARM 7 CPU. Raspbian and others use the lowest common denominator for backwards compatibility, which is ARM 6.... While this will only give a tiny speed gain, on a machine as low powered as Raspberry every little bit helps.
I have also provided, using Gentoo Release Engineer Tool "catalyst", a stage-3 to use the NEON fpv4 floating point. ARM have a page that explains the NEON instruction set extension, in short its for fast multimedia at the expense of some math precision. NEON fpv4 is hardware to accelerate audio, video, 3-D graphics, image, and speech processing. GCC Manual explains that because NEON does not fully implement the IEEE 754, by default it is disabled, and needs a flag(s) to turn it back on. GCC offers the -ffast-math flag which is a shortcut for several options, presenting the least conforming but fastest math mode.
|Name||URL||Floating Point Unit||Hardware Accelerated Audio Video||IEEE 754|
CFLAGS="-02 -pipe -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard " OR CFLAGS="-02 -pipe -march=armv7-a -mfpu=neon-vfpv4 -ffast-math -mfloat-abi=hard "
Generic : vfpv 3
Gentoo Generic ARMv7-a with slower higher precision IEEE 754 Floating Point and disabled multi-media hardware support.
Gentoo stage3-armv7a_hardfp ( floating point model 3) CFLAGS="-02 -pipe -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard "
root@raspberrypi:/media/pi# cd /mnt/genoot/ root@raspberrypi:/mnt/genoot# wget "http://mirror.bytemark.co.uk/gentoo/releases/arm/autobuilds/current-stage3-armv7a_hardfp/stage3-armv7a_hardfp-20160325.tar.bz2" . . . . . . root@raspberrypi:/mnt/genoot# tar xvjpf stage3-*.tar.bz2 --xattrs
Alternative : neon vfpv 4
For hardware accelerated audio, video, 3-D graphics, image, and speech processing.
Optimized stage3-armv7a_neonvfpv4_( floating point model 4 + NEON ) CFLAGS=" -02 -pipe -march=armv7-a -mfpu=neon-vfpv4 -ffast-math -mfloat-abi=hard "
root@raspberrypi:/media/pi# cd /mnt/genoot/ root@raspberrypi:/mnt/genoot# wget "http://ukginger.net/Gentoo2/releases/arm/autobuilds/current-armv7a_neonvfpv4_hardfp/stage3-armv7a_neonvfpv4_hardfp-20160402.tar.bz2" . . . . . root@raspberrypi:/mnt/genoot# tar xvjpf stage3-*.tar.bz2 --xattrs
You could edit /etc/portage/make.conf and remove the -ffast-math to turn the IEEE 754 back on, but you will effectively disable the hardware acceleration. You will probably want to add the global USE flag "neon" inside /etc/make.conf .
Anyway... which ever Stage-3 you choose it is still going to be a Raspberry and not magically change into a Super Computer. Both options are faster than Raspbian. Another problem is the video driver for the Raspberry, support for things like Hardware Accelerated OpenGL is experimental, but the situation is rapidly developing. Broadcom has released full documentation for the VideoCore IV , and some source code, so the situation is getting better.
Also gcc has delivered speed gains, poor old Raspbian is still using gcc 4.6.3 - but gentoo is using 4.9.3 and the code generated is estimated to be more than 10% faster... Since both stage-3 tarballs are compiled with 4.9.3, you should get some speed improvement.
It will now write the basic system to the USB Hardrive, so it will take a few minutes as USB Hardrives are not known for lightning speed. It is about 2 seconds quicker without the verbose switch, but you can not see what is going on and you have nothing to see. It takes about 4-5 minutes to extract and unpack everything.
To help you decide, here are some background reading links
- GCC ARM : https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
- GCC Floating Point Math : https://gcc.gnu.org/wiki/FloatingPointMath
- ARM NEON http://www.arm.com/products/processors/technologies/neon.php
- Funtoo http://www.funtoo.org/Armv7a_neonvfpv4_hardfp
- Wikipedia ARM NEON https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29
- Wikipedia List of ARM micro-architectures https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures
- Cortex-A7 https://en.wikipedia.org/wiki/ARM_Cortex-A7
- Portage Snapshots I used to compile stage3-armv7a_neonvfpv4_hardfp snapshots.
Next : Install Portage - ( packaging system )