Archive for December, 2013

Aarch64/ARM64 in Gentoo

December 7, 2013

Hi all,

After some months(the stage I was trying to build has a release tag of 20130523…) trying to bootstrap a Gentoo aarch64 stage3 using the ARMv8 Foundation Model, which is REALLY slow, ‘dlan’ from the #gentoo-embedded IRC channel told me about the entry of ARM64 with QEMU in the Debian wiki.

In that wiki entry they talk about using the QEMU ARM64 user-space emulation done by the people of SuSE Linux. This port is to be incorporated to QEMU 1.8.

When you use the user-space emulation, the compilation is really fast compared to using a full-system emulation. So compared to using the ARMv8 Foundation Model, it was really fast to finally be able to build a stage3. During these months I’ve had to find a combination of toolchain packages(binutils, gcc, glibc) that worked fine. The stage3 was built using the stable arm keyword.

Things I’ve had to do to build a stage3 that are not integrated in the gentoo-x86 tree(that I know, at least):

  • Build everything with USE=”-berkdb -gdbm -pcre”.
    • dev-libs/libpcre fails to build because aarch64 is not supported
    • dev-libs/db fails to build because of assembler errors
    • sys-libs/gdbm I do not remember what was the issue
  • Build sys-apps/busybox with USE=”-static”, as it fails to link otherwise.
  • Use sys-devel/binutils-2.23.2 with some patches: patch 1 and patch 2 . Those are probably present in binutils-2.24.
  • Use linaro gcc-4.8-2013.09. If I remember correctly, gcc-4.8.2(the latest version on gentoo-x86), didn’t had aarch64 support. An alpha of gcc-4.9.0 seemed to work fine, but I decided to try what was supposed to work fine. I’m going to try with gcc-4.8.2 again and if that fails, with an alpha of gcc-4.9.
  • Use sys-apps/coreutils-8.21 with the following patch:
  • Use dev-lang/python-3.2.5 with the following patch:
  • Use the latest versions of: dev-libs/libffi, sys-apps/coreutils.

The stage3 can be downloaded from:

Have fun.