Skip to content

messense/homebrew-macos-cross-toolchains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2a0a403 Â· Sep 23, 2024

History

92 Commits
Sep 20, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 19, 2024
Sep 18, 2024
Aug 16, 2021
Apr 14, 2023
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024
Sep 23, 2024

Repository files navigation

macos-cross-toolchains

🚀 Help me to become a full-time open-source developer by sponsoring me on GitHub

macOS cross compiler toolchains, supports both Apple Silicon & Intel Macs.

Download precompiled toolchains from GitHub Release

Or install using Homebrew:

brew tap messense/macos-cross-toolchains
# install x86_64-unknown-linux-gnu toolchain
brew install x86_64-unknown-linux-gnu
# install aarch64-unknown-linux-gnu toolchain
brew install aarch64-unknown-linux-gnu

Use with Rust

Suppose you have installed x86_64-unknown-linux-gnu toolchain and have it on PATH, setup the environment variables as below to use it with Cargo.

export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc

Usually only CARGO_TARGET_*_LINKER is required, in case it somehow fails to compile, you can also set some extra environment variables:

export CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc
export CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++
export AR_x86_64_unknown_linux_gnu=x86_64-linux-gnu-ar