Write a Relm application for your Linux phone

Warning: This has not been thoroughly tested; use at your own risk. (This could mess up with your actual pacman config.)

Create pacman config for ARM

cp /etc/pacman.conf arm_pacman.conf

Edit the following options to this:

RootDir     = /opt/ArchARM
DBPath      = /opt/ArchARM/var/lib/pacman/
CacheDir    = /opt/ArchARM/var/cache/pacman/pkg/
GPGDir      = /opt/ArchARM/etc/pacman.d/gnupg/
HookDir     = /opt/ArchARM/etc/pacman.d/hooks/
Architecture = aarch64

And change all the includes (for e.g. the core/extra/… repos) to:

Include = ./mirrorlist

Create the mirrorlist file

Server = http://nj.us.mirror.archlinuxarm.org/$arch/$repo

Install the ArchLinux ARM keyring, pacstrap and AArch64 gcc

Using an AUR wrapper or otherwise for the keyring:

yay -S aarch64-linux-gnu-gcc archlinuxarm-keyring arch-install-scripts

Initialize the pacman database and install the ARM packages

sudo mkdir /opt/ArchARM
sudo pacstrap -M -C arm_pacman.conf /opt/ArchARM gtk3 libhandy

(Ignore all the failed execv call errors.)

Add the rust target for AArch64

rustup target add aarch64-unknown-linux-gnu

Configure the linker sysroot

.cargo/config
[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=--sysroot=/opt/ArchARM"]

Build your relm project

set -x PKG_CONFIG_SYSROOT_DIR /opt/ArchARM/
set -x PKG_CONFIG_ALLOW_CROSS 1
set -x PKG_CONFIG_PATH /opt/ArchARM/lib/pkgconfig/
set -x CARGO_BUILD_TARGET aarch64-unknown-linux-gnu
set -x CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER aarch64-linux-gnu-gcc