Building for ARM systems

Dan Nicholson nicholson at endlessm.com
Tue Mar 7 12:08:41 UTC 2017


On Tue, Mar 7, 2017 at 4:58 AM, Bastien Nocera <hadess at hadess.net> wrote:
> On Tue, 2017-03-07 at 03:05 +0100, Aleix Pol wrote:
>> Dear Flatpak'ers,
>> As some of you already know, I've been poking around trying to find
>> some kind of system where we can build the KDE runtime and
>> applications for ARM.
>
> For the applications, the fix is a package install on the build system,
> and a flatpak-builder option away. See this post as well as the
> original one:
> http://www.hadess.net/2016/10/flatpak-cross-compilation-support.html

We use this QEMU setup at Endless for our ARM apps. It's slow but
works fine for apps. I think building a whole runtime would be
painful, but you could give it a shot.

The details in Bastien's post is that if you have qemu-user-static
installed with the appropriate binfmts (usually provided in distro
packaging), then you can run binaries emulated for any architecture
QEMU supports. On linux-4.8+, the interpreter associated with the
binfmt is opened immediately by the kernel and kept open so it doesn't
need to live in the mount namespace setup by flatpak. Pass the
appropriate arch to flatpak-builder and it magically works.

On older kernels you can still do it, but you have to somehow get the
interpreter path used in the binfmt definition included in the
sandbox. One way would be to include qemu-user-static in the SDK at
the same path as the host (e.g., /usr/bin/qemu-arm-static). What I did
at Endless was hack the binfmt definition to use /run/qemu-arm-static
and then add a bind mount from the host into the sandbox at that
location.

--
Dan



More information about the xdg-app mailing list