Codebase list arch-test / debian/0.2-1 README
debian/0.2-1

Tree @debian/0.2-1 (Download .tar.gz)

README @debian/0.2-1raw · history · blame

This tool will tell you "can your machine+kernel run architecture X?".

The check is for the ability to run machine code and supporting appropriate
syscall ABI, not for the presence of userland libraries.  Ie, a positive
answer means you can use a chroot or container of that architecture, add it
to your multiarch set, etc, but doesn't mean you can currently run non-static
binaries without installing required libraries.

Architectures detected by this version of arch-test are:
 * amd64, i386, x32
 * mips, mipsel, mips64, mips64el
 * arm, armel, armhf, arm64
 * powerpc, ppc64, ppc64el
 * m68k
 * sh4
 * s390x
 * sparc, sparc64
 * illumos-amd64
 * win32, win64


Adding new archs
================

Helper programs are supposed to write the string "ok\n" to stdout then
return exit code 0.  This can be done by statically compiling "generic.c"
for the given architecture.  Unfortunately, doing so with glibc produces
~800KB executables which multiplied by the number of archs to test would
take too much space for such a minor tool.

And, for non-baseline archs some specific code is needed.  Examples:
* ppc64el requires POWER8, some versions of qemu-user can run little-endian
  PPC64 but lack some instructions required by the Debian arch.
* armhf uses same syscall ABI with armel.

One way to ascertain required support is trying to run an unprivileged
instruction that's lacking on older versions of the ISA.  This causes the
helper program to fail with SIGILL/SIGFPE/etc which means it will return
an exit code other than 0.


Missing Debian architectures
============================

* kfreebsd-*: no cross binutils in unstable (uses a different format, unlike
  hurd and Solaris which share it with Linux)
* hurd-*: how do you even do syscalls there?!?  Trying to figure it out
  exhausted my attention span.  RTFSing glibc, I see it's something bizarre:
  _exit() requests some server to terminate the process then goes into an
  endless loop of dividing 1/0.
* alpha: no machine to test it on, I'm reluctant to trust qemu exclusively
* hppa: no machine to test, not even supported by qemu
* ia64: no cross binutils
* powerpcspe: no machine, debootstrap in qemu fails


Resources
=========

man 2 syscall
git://github.com/deater/ll_asm.git