From 1edaabde93201ae74a92916914cb163c0ba9557d Mon Sep 17 00:00:00 2001 From: Shashwat Ganesh Date: Thu, 29 Dec 2022 01:56:08 +0530 Subject: [PATCH] Cross compile for arm64 --- build.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..3129b96 --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +SYSROOT=/build/root + +export PKG_CONFIG_DIR= +export PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig +export PKG_CONFIG_SYSROOT_DIR=${SYSROOT} +export PKG_CONFIG_ALLOW_CROSS=1 +# tell pkg-config where to find libudev.pc +export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig +# tell cargo to link with an armhf compatible linker +export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc + +cargo build --release --target=aarch64-unknown-linux-gnu