rustup target add aarch64-unknown-linux-gnu is not enough. Cross compiling to linux on windows is not a good choice. just as bjorn3's reply, if you configure your system correctly, rust-lld will work well. I also recommend to use zig cc as linker for cross-compilation. cargo-zigbuild is a crate wh… Answer from c00t on users.rust-lang.org
Discussions

Rust Bare-Metal Cross-Compilation for AArch64: can't find crate for `core` - Stack Overflow
I am trying to cross-compile an example rust code as library for bare-metal AArch64 on Linux (KDE-Neon). Unfortunately it does not work. This is my example rust code (lib.rs): #![no_std] #[no_mang... More on stackoverflow.com
🌐 stackoverflow.com
Ways to cross-compile Rust for aarch64 android target
I assume for a library? cargo build --target aarch64-linux-android More on reddit.com
🌐 r/rust
9
0
July 7, 2025
[Solved] Cross compile to aarch64 from windows10
Greetings, using rust for a while, and I just got myself some few orangepi devices lately.. I am trying to compile from windows10 machine(MINGW64_NT-10.0) a simple hello world and try to run it in a aarch64 system(and hopefully other devices too like omega 2+). it works obviously in cargo run ... More on users.rust-lang.org
🌐 users.rust-lang.org
0
0
November 29, 2018
Compiling with `cross-rs` to `aarch64-unknown-linux-gnu`
In any case, do you have any instructions on how to cross-compile this crate to aarch64-unknown-linux-gnu? ... ❯ RUST_BACKTRACE=full cross build --target=aarch64-unknown-linux-gnu -vv + cargo metadata --format-version 1 --filter-platform aarch64-unknown-linux-gnu + rustc --print sysroot + ... More on github.com
🌐 github.com
6
April 30, 2023
🌐
GitHub
github.com › cross-rs › cross
GitHub - cross-rs/cross: “Zero setup” cross compilation and “cross testing” of Rust crates
This Just Works $ cross build --target aarch64-unknown-linux-gnu # EVEN MORE MAGICAL! This also Just Works $ cross test --target mips64-unknown-linux-gnuabi64 # Obviously, this also Just Works $ cross rustc --target powerpc-unknown-linux-gnu ...
Starred by 8.1K users
Forked by 449 users
Languages   Rust 58.8% | Shell 20.0% | Dockerfile 12.8% | Python 7.3%
🌐
Stack Overflow
stackoverflow.com › questions › 70559555 › rust-bare-metal-cross-compilation-for-aarch64-cant-find-crate-for-core
Rust Bare-Metal Cross-Compilation for AArch64: can't find crate for `core` - Stack Overflow
rustup component add rust-std-aarch64-unknown-none error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rust-std-aarch64-unknown-none' for target 'x86_64-unknown-linux-gnu' note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html
🌐
Rust Programming Language
users.rust-lang.org › help
[Solved] Cross compile to aarch64 from windows10 - help - The Rust Programming Language Forum
November 29, 2018 - Greetings, using rust for a while, and I just got myself some few orangepi devices lately.. I am trying to compile from windows10 machine(MINGW64_NT-10.0) a simple hello world and try to run it in a aarch64 system(and hopefully other devices too like omega 2+). it works obviously in cargo run ...
🌐
GitHub
github.com › twistedfall › opencv-rust › issues › 457
Compiling with `cross-rs` to `aarch64-unknown-linux-gnu` · Issue #457 · twistedfall/opencv-rust
April 30, 2023 - ... ❯ RUST_BACKTRACE=full cross build --target=aarch64-unknown-linux-gnu -vv + cargo metadata --format-version 1 --filter-platform aarch64-unknown-linux-gnu + rustc --print sysroot + ...
Author   shtrophic
Find elsewhere
🌐
Rust Programming Language
users.rust-lang.org › help
Cross compiling arm - help - The Rust Programming Language Forum
July 5, 2023 - Hi, I'm trying to cross compile raylib(essentially glfw w/ extras) from my host x86 archlinux to arm64 linux /usr/lib/gcc/aarch64-linux-gnu/13.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lX11: No such file or directory collect2: error: ld returned 1 exit status ^ with cargo build --target aarch64-unknown-linux-gnu , I presume I need the arm64 version of x11 installed or something? and the following is done with cross --- stderr CMake Error at /usr/local/share/cmake-3....
🌐
Stack Overflow
stackoverflow.com › questions › 78845548 › rust-cross-compile-aarch64-unknown-linux-gnu-linker-error
gcc - Rust cross compile aarch64-unknown-linux-gnu linker error - Stack Overflow
FROM rust:bookworm RUN rustup toolchain install stable RUN rustup default stable RUN apt-get update && apt-get install -y multistrap curl gcc-aarch64-linux-gnu libgtk-4-dev debian-archive-keyring libglib2.0-dev libc6-dev-arm64-cross RUN rustup target add aarch64-unknown-linux-gnu COPY multistrap.conf / RUN multistrap -f multistrap.conf -d /usr/aarch64-linux-gnu ENV RUSTC_LOG="rustc_codegen_ssa::back::link=info" ENV RUSTFLAGS="-C link-arg=--sysroot=/usr/aarch64-linux-gnu -C link-arg=-Wl,--verbose" ENV PKG_CONFIG_SYSROOT_DIR="/usr/aarch64-linux-gnu" ENV PKG_CONFIG_LIBDIR=/usr/aarch64-linux-gnu/u
🌐
Tangram Vision
tangramvision.com › blog › cross-compiling-your-project-in-rust
Tangram Vision Blog | Cross-Compiling Your Project in Rust
February 13, 2024 - [toolchain] channel = "1.75.0" components = ["clippy", "rustfmt", "rust-std"] targets = [ # Linux Targets "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", # Apple Targets "x86_64-apple-darwin", "aarch64-apple-darwin", # Etc... ] profile = "default" This provides a clear and easy way to reference what targets are supported, but also makes it easy to always use a consistent toolchain for compiling and cross-compiling to different targets.
🌐
Stack Overflow
stackoverflow.com › questions › 72583828 › cross-compiling-rust-on-win10-for-aarch64-linux
windows - Cross-compiling Rust on Win10 for aarch64/Linux - Stack Overflow
I think it's a problem with freetype because it requires installing a library first. Maybe it's not possible to cross-compile at all because of this. ... You might have more joy using WSL to build the cross-tools. I built musl-cross-make (to target the RG351 handheld) without issue under WSL and am moving onto rust next.
🌐
Reddit
reddit.com › r/rust › cross compiled binary for aarch64 architecture not running
r/rust on Reddit: Cross compiled binary for aarch64 architecture not running
October 6, 2022 -

I am trying to cross compile rust. I am able to build and compile the binary successfully, however when i run this binary on aarch64 architecture, i get the following error

```

./crossed: /lib/libc.so.6: version `GLIBC_2.33' not found (required by ./crossed)

./crossed: /lib/libc.so.6: version `GLIBC_2.32' not found (required by ./crossed)

./crossed: /lib/libc.so.6: version `GLIBC_2.34' not found (required by ./crossed)

```

I am not sure what i did wrong. can you please help me out.
I have used the cross-rs tool and it works properly and generates a binary that is working but i am not sure what i am doing wrong. I am using aarch64-unknown-linux-gnu as target compiler

🌐
Heaths
heaths.dev › rust › 2025 › 05 › 11 › cross-compiling-x64-on-aarch64.html
Cross-compiling x64 on Aarch64 | Heath Stewart’s Blog
May 11, 2025 - The last line was just for convenience, which apt did for aarch64-linux-gnu-gcc and, originally, when I installed gcc-13-x86-64-linux-gnu standalone. I was finally able to cross-compile openssl-sys: cargo build PKG_CONFIG_SYSROOT_DIR=/usr/lib/x86_64-linux-gnu cargo build --target x86_64-unknown-linux-gnu · Tags: gcc, rustlang, tips, wsl
🌐
FreeBSD
forums.freebsd.org › non-i386/amd64 and embedded › embedded
Cross-compiling Rust for aarch64 from amd64 | The FreeBSD Forums
May 6, 2024 - [target.aarch64-unknown-freebsd] linker="aarch64-unknown-freebsd14.0-gcc12" Then I'm adding nightly toolchain rustup +nightly component add rust-src And then I execute cargo +nightly build -Z build-std --target aarch64-unknown-freebsd Where I am seeing that all dependencies compiled but then linker is throwing error
🌐
Pmnxis
pmnxis.github.io › posts › cross_compiling_aarch64_rust_for_linux_from_x86_64_linux
Cross compiling aarch64(arm64) rust for linux from x86_64 machine · Jinwoo Park Blog
October 3, 2022 - In Kernel hacking -> Rust hacking , enables it and inside menus. # -j4 for 4 core virtual machine, -j2 for 2 core, -j1 for single core. make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 -j32
🌐
Krinkinmu
krinkinmu.github.io › 2020 › 12 › 13 › adding-rust-to-aarch64.html
Adding a little bit of Rust to AARCH64 | Welcome to the Mike’s homepage!
December 13, 2020 - First things first, we need the toolchain to cross compile for the target platform. Rust toolchain is based on LLVM, so I didn’t expect any problems with that. One difference between default distribution of Clang/LLVM I have in Ubuntu and Rust/Cargo is that Clang somehow comes with the built-in support for all the architectures supported by LLVM, but in case of Rust I had to install it: ... It’s rather hard to find what is the exact configuration of the aarch64-unknown-none target, but we can see some basic configuration parameters of the target using nightly version of the toolchain:
🌐
Konifay
konifay.io › blog › 2026-0001-cross-compile-rust-fedora
Cross-Compiling a rust app for target aarch64 on host x86_64 using Fedora 42 - konifay
February 5, 2026 - Sets up a compilation environment (rust, cargo, gcc, ..) as well as the aarch64 sysroot within the container itself, so you'll need to modify it to your specific project needs! FROM fedora:42 # Install build dependencies (including C++ cross-compiler and CMake) RUN dnf install -y \ gcc \ gcc-c++ \ gcc-aarch64-linux-gnu \ gcc-c++-aarch64-linux-gnu \ sqlite-devel \ make \ curl \ pkg-config \ clang \ cmake \ git \ && dnf clean all # Copy rust-toolchain.toml to read the version COPY rust-toolchain.toml /tmp/rust-toolchain.toml # Install Rust using rustup with version from rust-toolchain.toml RUN R
🌐
Bryan Burgers
burgers.io › cross-compile-rust-from-arm-to-x86-64
Cross-compiling Rust from ARM to x86-64 | Bryan Burgers
July 14, 2020 - But ring – a crypto library that ... my cross compiler. Let's take a longer look at more of the error log. $ cargo build --release --target x86_64-unknown-linux-musl error: failed to run custom build command for `ring v0.16.15` Caused by: process didn't exit successfully: `/home/ubuntu/crossed/target/release/build/ring-082dc03a36bb5ba5/build-script-build` (exit code: 101) --- stdout OPT_LEVEL = Some("3") TARGET = Some("x86_64-unknown-linux-musl") HOST = Some("aarch64-unknown-l...