Skip to content

Instantly share code, notes, and snippets.

@HirbodBehnam
Last active May 10, 2024 13:11
Show Gist options
  • Save HirbodBehnam/cd9b21e4879e1fa800f7972982b83afd to your computer and use it in GitHub Desktop.
Save HirbodBehnam/cd9b21e4879e1fa800f7972982b83afd to your computer and use it in GitHub Desktop.
The Cargo config file I use for cross compiling
# Place this file as $CARGO_HOME/config.toml
# Run this command before compiling anything to install compilers
# apt install apt install gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu gcc-mingw-w64
[target.x86_64-unknown-linux-musl]
linker = "rust-lld"
[target.aarch64-unknown-linux-musl]
linker = "rust-lld"
[target.x86_64-unknown-linux-gnu]
linker = "x86_64-linux-gnu-gcc"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
[target.i686-pc-windows-gnu]
linker = "i686-w64-mingw32-gcc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment