Skip to content

Commit

Permalink
Cross compile for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
kknives committed Dec 28, 2022
1 parent 31272fb commit 1edaabd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1edaabd

Please # to comment.