Aarch64/ARM64 in Gentoo

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: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698330
  • Use dev-lang/python-3.2.5 with the following patch: http://bugs.python.org/issue16962
  • Use the latest versions of: dev-libs/libffi, sys-apps/coreutils.

The stage3 can be downloaded from:http://gentoo.osuosl.org/experimental/arm/arm64

Have fun.



3 Responses to “Aarch64/ARM64 in Gentoo”

  1. Janne Says:

    Please note that qemu aarch64 user emulation is still incomplete and buggy.

    You if you had used a revision before the movi 64bit immediate vector variant was fixed last week, programs compiled with gcc-4.8 could randomly crash (seen while running libav’s fate test suite). With that fix gcc-4.8.2 should work fine at least my crossdev aarch64-gcc-4.8.2 works well enough for libav.

    Is there a reason why you’re not using crossdev to build the stage3? That would be even faster than qemu-user. I can see that building the stage3 natively is a good validation but for the initial port crossdev should be faster.

  2. New AArch64/arm64 stage3 available | Armin76's Blog Says:

    […] Gentoo « Aarch64/ARM64 in Gentoo […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: