$ sudo apt-get update
$ sudo apt-get install gcc-aarch64-linux-gnu --fix-missing
$ rustup target add aarch64-unknown-linux-gnu
Then, to build a workspace to
$ RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" cargo build --target aarch64-unknown-linux-gnu
# .cargo/config can be configured with the correct linker and target
# instructions adapted from https://wiki.macchiatobin.net/tiki-index.php?page=OpenSSL+Installation+Guide
$ git clone https://github.com/openssl/openssl.git
$ export CROSS_COMPILE=aarch64-linux-gnu-
$ export ARCH=arm64
$ git checkout OpenSSL_1_0_2-stable
$ mkdir build
$ ./Configure linux-aarch64 --cross-compile-prefix=${CROSS_COMPILE} --prefix=<path-to-openssl-installation>/build shared
$ make depend
$ make -j5
$ make install
$ export PKG_CONFIG_ALLOW_CROSS=1
$ export OPENSSL_STATIC=true
$ export OPENSSL_DIR=<path-to-openssl-installation>/build
$ RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" cargo build --target aarch64-unknown-linux-gnu