[CentOS-devel] Building ARM64 RPMs on AMD64?

Sat Dec 5 19:39:07 UTC 2020
Neal Gompa <ngompa13 at gmail.com>

On Sat, Dec 5, 2020 at 2:15 PM Simon Matter <simon.matter at invoca.ch> wrote:
>
> Hi,
>
> We are thinking about adding ARM64 based devices to our systems.
>
> As we are using CentOS almost everywhere and have quite a number of
> inhouse RPM packages in our company repository, we'd like to enhance it
> and add ARM64 alias aarch64 to it.
>
> What I'm still wondering is how to run the build environment for the new
> arch?
>
> How does the CentOS project do it, run ARM64 hardware or using emulation?
> Or to ask differently, is it an option to run the build system emulated
> with QEMU?
>
> Thanks for any insights?

The Mock tool from Fedora EPEL supports automatically running
emulation for foreign architectures for building packages if
qemu-user-static is installed. That makes building AArch64 packages
from x86_64 or vice versa pretty simple.

To build a package for aarch64 from x86_64 from a fresh system using Mock:

$ sudo dnf install mock qemu-user-static
$ sudo usermod -a -G mock $USER
$ newgrp mock
$ mock -r epel-8-aarch64 </path/to/package.src.rpm>



--
真実はいつも一つ!/ Always, there's only one truth!