1arch-test(1)                General Commands Manual               arch-test(1)
2
3
4

NAME

6       arch-test - detect architectures your kernel can run binaries of
7

SYNOPSIS

9       arch-test [-n]
10              enumerates the architectures
11
12       arch-test [-n] [-c <chroot>] <arch>
13              tests a single arch
14

DESCRIPTION

16       When  called  without an argument, arch-test outputs the list of archi‐
17       tectures executable by your running kernel, one per line, using  Debian
18       arch  names.   Libc or other libraries are neither needed nor checked —
19       an arch is listed if its machine code can be executed and the appropri‐
20       ate  syscall  ABI  is supported by the kernel.  This means, you can run
21       these architectures in a chroot or a container, execute them using mul‐
22       tiarch, run static binaries, etc.  The ability to run additional archi‐
23       tectures can be gained via binfmts on Linux, Linux  emulation  on  BSD,
24       etc.
25
26       An  architecture is considered runnable only if your kernel can run un‐
27       modified binaries, without extra steps such  as  recompiling  (Raspbian
28       armhf)  or using brandelf on binaries you'd want to run (FreeBSD emula‐
29       tion of Linux).  Also, as Debian requires 686 on i386 as of the stretch
30       release, 686 support is checked for.
31
32       If -n is specified, arch-test will try to disable known emulators (cur‐
33       rently qemu and wine).  Note that a whole-machine emulator  appears  to
34       be native as far as the kernel is concerned.
35
36       With -c <chroot>, the test is done inside a given chroot (qemu-user be‐
37       fore 2.12 required the interpreter to live inside  the  chroot).   Root
38       privileges are required here.
39
40       When called with an arch name as an argument, arch-test tests the spec‐
41       ified architecture.  A human-friendly message will be printed, and  the
42       exit code can be:
43
44       0      congratulations, the arch can be run on your kernel
45
46       1      failure
47
48       2      cannot check — arch-test lacks a helper for this arch
49
50
51       (Shell hint: with set -e you write: ret=0; arch-test $ARCH || ret=$?)
52
53
54   Helper programs
55       The detection is done by small programs located in /usr/lib/arch-test/.
56       These programs check whether the running kernel can execute binaries of
57       a  given  architecture.   When  run,  if  successful, each such program
58       prints "ok" on stdout and returns exit code 0.
59
60       When the check fails, these helper programs may die horribly  —  always
61       with  a  non-zero exit code.  Usually the kernel will notice the incom‐
62       patibility and nicely abort the attempt, but in  some  near-miss  cases
63       the  failure  is more messy, such as SIGILL or SIGSEGV.  If you want to
64       run the helpers directly, you'd want to redirect  stderr  to  /dev/null
65       and to disable core dumps (ulimit -c 0).
66
67
68
69                                                                  arch-test(1)
Impressum