Last active
September 13, 2025 13:44
-
-
Save HirbodBehnam/cd9b21e4879e1fa800f7972982b83afd to your computer and use it in GitHub Desktop.
The Cargo config file I use for cross compiling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place this file as $CARGO_HOME/config.toml | |
# Run this command before compiling anything to install compilers | |
# apt install gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu gcc-mingw-w64 pkg-config-aarch64-linux-gnu | |
# You might also add packages like this: | |
# dpkg --add-architecture arm64 | |
# apt update | |
# apt install libssl-dev:arm64 pkg-config pkg-config:arm64 | |
# export PKG_CONFIG=aarch64-linux-gnu-pkg-config | |
[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