Skip to content

Commit

Permalink
fix: configure aarch64-unknown-linux-* cross-compilation
Browse files Browse the repository at this point in the history
Sadly, simply installing `gcc-aarch64-linux-gnu` isn't quite enough to
cross-compile from `x86_64` linux to `aarch64`, we also need to:

- Override `cc` for the `aarch-64-unknown-linux-musl` target (there's no
  `gcc-aarch64-linux-musl` package).
- Override the linker for both targets (for some reason `cargo` doesn't
  apply the same default behaviour here as it does for `cc`).
  • Loading branch information
connec committed Apr 13, 2024
1 parent 59de195 commit ebd9934
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[env]
CC_aarch64_unknown_linux_musl = "aarch64-linux-gnu-gcc"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-gnu-gcc"

0 comments on commit ebd9934

Please sign in to comment.