#!/usr/bin/env bash # The core for an ARM handheld (ROCKNIX and the like: aarch64 Linux, glibc), # cross-built with zig as the linker (cargo-zigbuild), against glibc 2.17 so # it loads on any distro newer than that. Needs zig on PATH (or ZIG_DIR), the # rustup target aarch64-unknown-linux-gnu, and `cargo install cargo-zigbuild`. # # scripts/build-aarch64.sh # target/aarch64-unknown-linux-gnu/handheld/libfamicom_libretro.so set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) if [ -n "${ZIG_DIR:-}" ]; then PATH=$ZIG_DIR:$PATH fi command -v zig >/dev/null || { echo "no zig on PATH (set ZIG_DIR)"; exit 1; } cargo zigbuild --manifest-path "$ROOT/Cargo.toml" --profile handheld --lib \ --target aarch64-unknown-linux-gnu.2.17 out=$ROOT/target/aarch64-unknown-linux-gnu/handheld/libfamicom_libretro.so ls -l "$out"