This page contains details about the port of Debian to the 64-bit Arm platform (arm64), known in some other places as AArch64. This port was released for the first time with Jessie (Debian 8).

Other ports to Arm hardware exist/have existed in Debian - see ArmPorts for more links and an overview

'arm64' is the Debian port name for the 64-bit Armv8 architecture, referred to as 'aarch64' in upstream toolchains (GNU triplet aarch64-linux-gnu), and some other distros.

The port was started in 2010 (by Arm and Linaro working with the community in commendable fashion) long before hardware was available so that there would be something to run when it arrived.

Hardware started to becoming available in October 2013, but access was restricted. Debian was very kindly donated two 8-core APM machines, installed in March 2014 running two buildds in Debian-ports. One was split with xen so we also had an unofficial porterbox. Arm supplied two Junos in August 2014, and Linaro 3 APM boxes in October, which are the current official build and porter machines.

Status

(last updated: July 29th 2022)

Official Debian port

Arm64 has been a first-class release architecture in Debian ever since Debian 8 'Jessie', with almost all packages built, and the standard installer working on various machines, and quite likely to work on new ones.

Hardware, emulators and models

Arm64 hardware was first available in the form of the iPhone 5 in 2013. Hardware useful for GNU/Linux started to become available from Q42013, with the first commercially available boards announced June 2014. More hardware including a couple of fairly cheap dev boards became available during 2015 (and it's also gone into quite a lot of android phones). Affordable Linux build machines became available in 2017.

Arm64 qemu user-space emulation became initially available in October 2013. It was added to qemu upstream in v2.0, and is available in Debian 8 (Jessie) onwards. This is much faster than the model for building software, but can't be used for kernel-space things like bootloader/kernel work, or anything that uses multithreading (such as java). See Qemu Rootfs below for details.

Arm64 qemu system emulation was added to qemu upstream and is available in Debian with qemu-system-arm 2.1+dfsg-1 or later.

There is a (non-free, free beer) 'Foundation Model' simulator which can be used to run arm64 code, which is available here

Much of the work packagers need to worry about is updating autoconf, multiarch and cross-build fixes, with a few actual arm64 changes here and there, and doesn't actually need a model or emulator.

This is the first non-x86 self-bootstrapped Debian/Ubuntu port: the first 150 packages cross-built using build-profiles to untangle cyclic build-dependencies.

History

Debian 8 'Jessie'

Arm64 is an official debian release architecture in Debian 8 'Jessie'. (Yay!)

By the freeze on 5th November 2014, 10220 packages (93% of the archive) were built, and all the bootstrap uploads had been rebuilt. So nearly everything you expect is in the release. The main things missing are mono (and dependencies), libvp8 (and thus nodejs ecosystem), fsharp, gcgo, rust. A few higher-level apps also didn't make it, such as abiword, and xbmc.

Debian-installer works on APM hardware if your machine has UEFI. It needs a patch to initramfs for Juno. AMD Seattle needs a newer kernel/DTB than the one in jessie.

Unstable

These pages gives some idea of the current status in unstable (all showing number of reverse dependencies followed by package name):

98% of Debian is currently built: over 12200 source (arch-specific) packages.

Packages in the 'Auto Not for Us', annotated with reasons/bugs (i.e packages marked as not to be built on arm64):

Packages which have failed to build:

Packages who's build-deps are not available:

68 packages remain that are failing due to out-of-date config.{sub,guess} files (down from a high of 300).

91 packages FTBFS in unstable (down from an initial peak of 630). Please check the packages in the 'Build Attempted' section there to see what needs fixing. Many of them are trivial fixes. (See bug-tracking below for info on bug-filing and resources on fixing).

Unofficial Debian-ports bootstrap

Debian unstable was bootstrapped in debian-ports, before debian-proper: http://buildd.debian.org/status/architecture.php?a=arm64&suite=sid

The debian-ports buildd was turned into a porterbox on 7th November as the job of -ports was done now that arm64 in the main archive was essentially completed.

Status details and history

Binutils, kernel, gcc and glibc port patches were sent upstream over the summer of 2012, with enough stuff to build a cross-toolchain available by October 2012. The initial port (2012) was done entirely as a cross-build using Ubuntu packages, initially quantal, then raring (from Jan 2013) to take advantage of cross-build fixes, multiarch improvements, libc and arm64 updates going in there. This port was done in Ubuntu because multiarch and the cross-toolchains were more advanced there than in Debian at the time, and Debian was frozen for Wheezy.The resulting image and updates were then used to natively build most of Saucy once real hardware that worked was available (to canonical). Trusty has 'most' stuff built. The missing stuff is largely unported languages (haskell, mono, ruby, go, etc) and large unported packages like libreoffice and firefox.

The initial Debian bootstrap (from late 2013) (350 source, 2100 binaries) was built in a personal repo ). This bootstrap was done natively starting with an Ubuntu Saucy base to supply a base chroot and non-library build-deps, lsb+dpkg-vendor was set to 'Debian', each package was built, uploaded and added to a Debianise script which replaced all available packages in the Saucy clean tarball chroot until it contained no Ubuntu packages and was effectively Debian unstable. Then a new clean debian chroot was debootstrapped and packages built/rebuilt in there using build profiles to break cycles.

Once hardware was available this Debian bootstrap image/repo was used to set up a real buildd for debian-ports and keep the port uptodate against unstable. Build profiles were again used to cleanly rebootstrap.

There are crosstoolchains built for Raring/Saucy/Trusty. Debian cross-toolchains are available in unstable (from Nov 2014) and https://people.debian.org/~wookey/tools/debian

Current cross-buildability (in Ubuntu) for arm64 is tracked on this status page. Native buildability is tracked at http://qa.ubuntuwire.org/ftbfs/arm64.html.

Installing with the installer

Debian installer is built daily for arm64 and netboot images are available here: http://d-i.debian.org/daily-images/arm64/

This works on an APM mustang/X-gene box or on qemu. It should also work on Arm Juno machines but will not install a working kernel, so you'll need to stick with the one you currently have, and contrive to boot the installer using a kernel that works.

Do please feedback installer successes or failures to the debian-arm mailing list.

Installer docs for arm64 are in the process of being created. Please help write them if you know anything of the subject.

$ sudo apt-get build-dep installation-guide
$ debcheckout installation-guide
$ cd installation-guide/build
$ ./buildone arm64 en pdf

Debootstrap arm64

Plain debootstrap will now produce an arm64 rootfs from the main archive.

First you need a valid key to verify the archive: If running unstable then just do:

sudo apt-get install debian-archive-keyring
sudo apt-key add /usr/share/keyrings/debian-archive-keyring.gpg

If running an older release you need to get the unstable keyring package (because the version in your release is probably too old to have the current key)

wget http://ftp.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2012.4_all.deb
sudo dpkg -i debian-archive-keyring_2014.4_all.deb

Now you can run debootstrap On an x86 machine, install qemu-user-static 2.0 or later (the package from unstable works fine on stable/testing), and:

sudo qemu-debootstrap --arch=arm64 --keyring /usr/share/keyrings/debian-archive-keyring.gpg --variant=buildd --exclude=debfoster unstable debian-arm64 http://ftp.debian.org/debian

Will do the whole process (creating an unstable chroot in the 'debian-arm64' dir).

If you have hardware or want to do it on qemu or a model), use these commands for a native debootstap:

sudo debootstrap  --keyring /usr/share/keyrings/debian-archive-keyring.gpg  --exclude=debfoster unstable debian-arm64 http://ftp.debian.org/debian

The old bootstrap repo at https://www.ports.debian.org/ still (Sept 2014) contains some packages not yet built in the official archive, but that should soon cease to be true. The even older bootstrap repo http://people.debian.org/~wookey/bootstrap/debianrepo2 is entirely obsolete and has now been deleted.

qemu

To use arm64 qemu, just install it from unstable/testing:

apt-get install qemu-user-static

This package installs fine on stable as well, and is available in backports.

(Note: Older qemu released referenced on this page used a different name for the static binary and binfmt-misc config (now qemu-aarch64-static, was qemu-arm64) and thus new config/old images (or vice versa) will not interoperate).

Using The Foundation model

See https://wiki.debian.org/Arm64Port/raringbootstrap#Raring_rootfs_for_Foundation_model

Here is a Ubuntu saucy disk image (92MB compressed, 2G uncompressed). Suitable for use with the foundation model or real hardware. This image is configured for armhf/arm64 multiarch usage, but it's a one-liner to turn that off.

And here's a suitable kernel (3.13, linaro foundation release 2014-01), modified for use with Linux instead of OE.

Porting packages for arm64 - Maintainer info

If your package does not build for arm64 it is usually trivial to fix, but sometimes a bit harder and sometimes a big deal. Here is info on what to change and where to go for help, updates and info.

autoconf updating

Most packages just need updated autoconf config info which includes the new arch. It is now best practice for (autotools-using) Debian packages to re-autoconf on every build in order to pick up this info automatically, or at least use the autotools-dev package to ensure latest config.sub and config.guess files. Good info on making these updates is on https://wiki.debian.org/Autoreconf

Nomenclature and defines

If your package does architecture-specific things explicitly then you will need to understand what names to use in tests.

The gnu name for the architecture (as given to configure) is aarch64-linux-gnu.

The debian name for the architecture is arm64

GCC defines __aarch64__ for the architecture.

Be careful of things which check for arm* in debian architecture tests, as it is usually wrong to do the same thing for arm64 as for 32-bit arm (arm/armel/armhf). In general, if you are not sure, you should do the same thing as on amd64 as that matches quite closely (64 bit, little endian, 32-bit ints and floats, 64-bit pointers, longs and doubles).

Check the link below for 'upstream package porting' to see if your package has had porting attention from Linaro.

There is also a big-endian version of the architecture/ABI: aarch64_be-linux-gnu but we're not supporting that in Debian (so there is no corresponding Debian architecture name) and hopefully will never have to. Nevertheless you might want to check for this by way of completeness in upstream code.

Useful porting docs

Porterboxes

If you need to test/fix on arm64 there are two porterboxes available:

DSA-maintained porterbox asachi.debian.org Non-DSA-maintained porterbox turfan.debian.net

Bug tracking

Please tag all arm64/aarch64-specific bugs 'arm64' (user=debian-arm@lists.debian.org, tag=arm64 - ) in the BTS (see bugs.debian.org/usertags for instructions), or in launchpad.

Here is an example (assuming you have a patch file, and a body template file)

reportbug $package  -V $version -A $patchfile --src --subject "Add arm64 support" --tag patch --pseudo-header 'User: debian-arm@lists.debian.org' --pseudo-header 'Usertag: arm64' --no-tags-menu --severity normal --body-file $template

Here is the current list of arm64 Debian bugs

Other distros often have useful bug-fixes already:

Upstream-relevant bugs should be filed in the linaro-aarch64 bug tracker to avoid distro duplication of effort. In this case, file bugs in the Debian BTS as well, then link to them in the Linaro tracker.

Repository

Packages are all in the Debian archive.

The initial debian (using ubuntu arm64 packages) and ubuntu bootstraps were stored here but are now obsolete. A quantal chroot was used for initial work but is now (Dec 2012) frozen/abandoned.

You should just be able to add that repo and apt-get install crossbuild-essential-arm64 to get a working cross environment. If build and host arch packages have got out of sync this won't work, which happens often in raring and unstable.

Cross Toolchain

Before anything useful can happen dpkg needs to have arm64 support. This was done in v1.16.4.

binutils-aarch64-linux-gnu is in debian unstable (from July 2014) (from the cross-binutils package)

Toolchain Bootstrap

First job is to bootstrap a cross-toolchain so other stuff can be built.

This is relatively easy to do from upstream sources either directly or using a framework like ?OpenEmbedded, but to get a Debian-packaged toolchain easily usable in chroots, sbuild etc requires merging the new port with the Debian packaging, which is, frankly, a PITA.

When starting from scratch multiarch doesn't help you because you need eglibc:arm64 to make aarch64-linux-gnu-gcc and you need aarch64-linux-gnu-gcc to make eglibc:arm64. So you have to do a 3-stage bootstrap.

Ubuntu has (thanks to Linaro) a package to automate the building of fully-bootstrapped compilers for armhf/el so that was munged to make arm64-cross-toolchain-base, and the delighful task of getting everything working was started.

The process is:

Easy peasy.

This work was initially done in Ubuntu due to better multiarch support, availability of *-cross-toolchain-base and newer eglibc.

Toolchain Bootstrap Issues

Quantal bootstrap

The initial arm64 packaged toolchain was done in Ubuntu Quantal, as the first release where multiarch crossbuilding basically worked. The details of this are documented on toolchain/BootstrapIssues#Quantal.

Raring bootstrap

Easier than quantal as all the base porting has already been done. However not quite as easy as one might like. arm64-cross-toolchain-base was updated with some fixes/updates from the armhf/armel-c-t-b packages. Binutils and linux-libc-dev headers were straightforward.

But gcc stage1 build fell over first with bugs in gcc-4.7.2-12ubuntu2 (patches that didn't apply, missing arm64 symbols-files). Then with missing bits/predefs.h header when building libgcc. This turned out to be 1091823.

Then the build completed but there was a libgconv.a packaging error for some reason. Updating to gcc-4.7-2-14ubuntu2 seemed to fix that.

Debian bootstrap

The Debian toolchain bootstrap is being attempted fully multiarch, to avoid the above issues with needing a separate libc:arm64 and equivs packages to make everything work. It's also an opportunity to integrate DEB_BUILD_PROFILE boostrap features to make it all nicely automatable, without toolchains being a special case in the archive. This was initially (December 2012) too troublesome, mostly due to new versions of GCC coming out every few days with this stuff being changed. As of gcc-4.7.2-18 onwards ThibG's patches for the toolchain using the multiarch system libraries are integrated so I had another go.

This process is documented on MultiarchCrossToolchains.

Current status is that experiemntal is being used as the stuff in unstable is too old.

binutils and gcc stage1 are built.

The kernel header patches are being updated for 3.8

Building packages

Given a cross-build chroot, in general you should be able to do

apt-get build-dep -aarm64 <package>
apt-get source <package>
cd <package>-<ver>
CONFIG_SITE=/etc/dpkg-cross/cross-config.arm64  DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --preserve-env -aarm64

But there are of course some caveats.

Details on setting up an arm64 cross-chroot are given here: https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/arm64bootstrap

There was no libssp (stack protection) support in the aarch64 toolchain on gcc-4.8 (and 4.7 pre-release)(https://cards.linaro.org/browse/TCWG-23) so the -fstack-protector would cause an error:

/usr/lib/gcc/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/bin/ld: cannot find -lssp_nonshared
/usr/lib/gcc/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/bin/ld: cannot find -lssp

For any package that uses dpkg-buildflags this is easy to fix by setting DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector You can set this for the whole build chroot if using one, or for a user, or for a build by doing:

DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector dpkg-buildpackage -aarm64

Better to fix this permanently in /etc/dpkg/buildflags:

STRIP CFLAGS -fstack-protector

With gcc-4.9 libssp is treated just as on any other major architecture.

Package porting

Many packages need no more than config.guess and config.sub updating to build for arm64. autotools got aarch64 support upstream in June 2012. So autotools-dev 20120608.1 has the files needed. However some packages don't autoreconfig on build, or otherwise update those files so they have to be patched. A lot of boring patches were filed with the tag arm64, such as 689613

In many cases dh_autoreconf can be used to fix this without making horrible, unreadable, autofoo patches. Sometimes it's better to use autotools-dev which only updates config.{sub,guess} without re-generating all the configury because this is less invasive, or the package simple doesn't autoreconf properly. dh-autoreconf is preferred as it covers all cases (for example the ppc64el port needs re-libtooling, so dh-autoreconf works, but the autotools-dev dh_updateconfig is not sufficient. Some packages won't build a second time after dh_autoreconf has poked them around. This QA page goes into more details about updating your packages

Using dose to see what is multiarch-buildable

Dose 3.1 can analyse build-dependencies for a given package, and understands about cross and multi-arch. It can tell you what is currently buildable given the current state of relevant source and package files. Use 3.1.2 for the --checkonly option and the --defaultedMAforeign option

Install it (it's in the bootstrap tools repo)

sudo apt-get install dose-builddebcheck

To check

dose-builddebcheck -f --checkonly <package> \
--defaultedMAforeign --deb-native-arch=amd64 --deb-foreign-archs=arm64 --deb-host-arch=arm64 \
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary-amd64_Packages \
/var/lib/apt/lists/people.debian.org_%7ewookey_bootstrap_ubunturepo_dists_quantal-bootstrap_main_binary-amd64_Packages \
/var/lib/apt/lists/people.debian.org_%7ewookey_bootstrap_ubunturepo_dists_quantal-bootstrap_main_binary-arm64_Packages \
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_universe_source_Sources | grep source


CategoryPorts