Description
There are a number of threads running on this - and after a very productive chat with a number of people at DockerCon last week and an internal review with the ARM Kernel/Distro and Toolchain team, I thought it would be useful to open the discussion here:
Firstly, the metadata in the image defines what the image contains, not what it will run on (as I have tried to express in #660). with this in mind, the baseline metadata requirements for ARM would be:
{
'arch': ['arm'|'arm64'] /* at some point in the future 'arm64ilp32' */
'variant': ['6' | '7' | '8']
'features': '...'
}
This means that for ARM, arch ~ ABI, variant ~ ISA.
We would ignore point releases of the architecture - 8.1, 8.2 etc as the extensions found can be expressed through HWCAPS and enabled in platform libraries. Any features that are present in the binary that are not detectable through HWCAPS will need to be expressed in the platform.features field. Neon for example is not assumed to be present in the platform, but should be runtime detectable. If however this is not possible, the usage of Neon would have to be expressed in the platform.features field.
There would be some baseline assumptions for all platforms, as we don't believe there is a need to enable all existing ARM platforms though this mechanism.
Baseline assumptions would be:
arch = arm
arm means everything is built to run little-endian, using A32 instructions, for AArch32 execution mode, using the EABI spec, with 16 floating point registers used by the ABI, so VFP hardware must be present.
This is the same default used by debian/ubuntu 'armhf', fedora 'armv7hf', rasbian, suse and Linaro as the 32-bit ARM base ABI. And is thus the default output of gcc targetting arm-linux-gnueabihf on those platforms [I hope - is this always true?]
It is expressed explicitly with -mfloat-abi=hard in gcc targeting arm-linux-gnueabihf (maybe some more options?)
Note that neon is not assumed to be present, and would need to be declared in features if used without runtime detection (it should always be used with runtime detection to make this moot).
https://wiki.debian.org/ArmHardFloatPort#Background_information is a useful page if you wish to understand the details of this.
Valid variants are currently '6' '7' '8'
arch = arm64
arm64 means everything is built to run little endian, using A64 instructions, for AArch64 execution mode, using the LP64 ABI. Documentation on the ARM ABI's can be found here http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html
This is the default arm64 ABI with 64-bit longs and pointers.
Assume use of base v8 instructions only. v8.1, 8.2 etc extensions must be declared in features if not runtime detected (runtime detection should be used to avoid having to do this).
This is the same default used by debian/ubuntu 'arm64', fedora/centos/redhat 'aarch64', Suse. And is thus the default output of gcc targetting aarch64-linux-gnu on these platforms.
Valid variants are currently '8'
arch = arm64ilp32
arm64ilp32 means everything is built to run little endian, using A64 instructions, for the AArch64 execution mode using the ilp32 ABI.
This is the rarely-used arm64 ABI using 32-bit ints, longs and pointers.
It is the default output of gcc targeting aarch64-linux-gnu_ilp32 or gcc targetting aarch64-linux-gnu with option -mabi=ilp32
Valid variants are currently '8'