Install Rust and Cargo. The easiest way to get Cargo is to install the current stable release of Rust by using rustup. Installing Rust using rustup will also install cargo. On Linux and macOS systems, this is done as follows: $ curl -sSf sh It will download a script, and start the installation. Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. For installation it's advised to use rustup as it will (among other things) allow you to switch between versions of Rust without having to download anything additional. Brew install rustup Use rustup to install the Rust compiler (rustc) and the Rust package.
Wanting to compile a small program I’d written in Rust to run on my home router, I found this guide to cross compilation of Rust code. The router is a Netgear R7000 with an ARM processor, running FreshTomato, a distribution of Linux for ARM and MIPS architecture consumer routers. The top of that guide shows an example of installing the cross-compilation toolchain for ARM on Ubuntu, but it required some work to adapt to Mac OS High Sierra, my desktop environment.
Open garden for mac. These programs and tools areavailable for various operating systems including Windows, Mac and others. Part 1 1.Garden PlannerFeatures and functions:Garden Planner is amazing free garden design software for Mac which has an easy to use and simple interface. Yes, there are many tools and softwaresavailable that can be downloaded on computer systems to do landscape designing.While some of these softwares are designed to be used by professionaldesigners, others can also be used by hobbyists. Thefollowing is a list of the top 3 freegarden design software for Mac that you can consider downloading.
The guide suggests rustup can be used to install extra cross compilation targets. I already have rustup which I’ve used to install Rust for Mac OS and keep it up-to-date, so that’s handy. So I ran “rustup target list” to list all the installable targets:
That’s a lot of possible targets. It looks like in the ARM space, there’s AArch64, arm-unknown, armebv7r, armv5te and armv7(r?) architectures of various variants. So, let’s google to see what kind of CPU the router has.
According to the OpenWRT wiki it’s a Broadcom BCM4709A0. So, what kind of architecture is that? Googling for “BCM4709A0” brought me to Wikidevi, which says it’s an ARM Cortex-A9. Looking at Wikipedia for the Cortex-A9 tells me:
- It’s a 32-bit architecture, so not AArch64
- It’s an ARMv7-A architecture
So I’d guess one of the armv7 targets is the best one. It’s probably not armv7-apple-ios or armv7-linux-androideabi, since this isn’t an iOS or Android OS. That leaves armv7-unknown-linux-gnueabihf, armv7-unknown-linux-musleabihf, armv7r-none-eabi and armv7r-none-eabihf. I know the router runs Linux, so let’s try the first two. I installed the armv7-unknown-linux-gnueabihf target with:
Saturation knob for macular degeneration. OK, let’s try compiling a “hello world” Rust application with that target:
That failed with a message “error: linking with cc failed: exit code: 1” and then a note showing the entire cc command, and a note saying:
OK, so I guess this is clang giving that error. Clang is the native C compiler for Mac OS, but I expect it can’t link an ARM executable in the way Rust wants. So, it looks like we need a linker for ARM. Reading the guide seems to suggest that Rust doesn’t have its own linker for Linux targets – it uses the linker from a C toolchain, for example the GNU C compiler. So we need to install a C toolchain targeting ARM.
My first stop when looking to install open source tools on Mac OS is Homebrew, and indeed there’s a formula on there for arm-linux-gnueabihf-binutils – it looks like that could be what we need to get a linker targeting ARM Linux. So let’s install that with:
That installs a set of tools named arm-linux-gnueabihf-addr2line, arm-linux-gnueabihf-ar and so on. I know the linker is normally invoked as “ld”, and cross-compilation toolchains by convention prefix their tool names with the target name, so the ARM Linux linker should be arm-linux-gnueabihf-ld. I know from the guide that this needs to go in ~/.cargo/config in a section like this:
But the Homebrew formula didn’t install arm-linux-gnueabihf-gcc – it only has arm-linux-gnueabihf-ld. Well, let’s try that instead, so the config is:
OK, let’s try compiling again…
This is more promising, but it looks like the linker can’t find all of those libraries to link with. Those look like parts of the GNU C library and other system libraries for Linux, which the Homebrew package arm-linux-gnueabihf-binutils doesn’t seem to include. These would normally be installed on a Linux system, but on Mac OS we don’t have them.
It seemed like I might need to install a more complete Linux toolchain that includes those libraries, but before trying that, let’s look at the other Rust target – armv7-unknown-linux-musleabihf. The “musl” in the name refers to the musl C library, a small C library that can be statically linked with Rust programs instead of the GNU C library. This sounds promising as it removes the need to link against libpthread, etc, which we had problems with earlier.
Let’s put the same linker configuration in ~/.cargo/config for the armv7-unknown-linux-musleabihf target:
And try compiling our Rust program with this target:
It built, so let’s copy the executable to the router:
Ms office for mac torrent. And then SSH on to the router and run it:
Great, it works! Using the musl C library and statically linking everything is somewhat less optimal than linking against the C library that’s already installed on Linux, as it means the built executable size is larger, but it’s good enough for a simple Rust program.
Support for different platforms are organized into three tiers, each with adifferent set of guarantees.
Platforms are identified by their 'target triple' which is the string toinform the compiler what kind of output should be produced. The columns in thetables below have the following meanings:
- std:
- ✓ indicates the full standard library is available.
- * indicates the target only supports
no_std
development. - ? indicates the standard library support is unknown or a work-in-progress.
- host: A ✓ indicates that
rustc
andcargo
can run on the host platform.
Tier 1
Tier 1 platforms can be thought of as 'guaranteed to work'.Specifically they will each satisfy the following requirements:
- Official binary releases are provided for the platform.
- Automated testing is set up to run tests for the platform.
- Landing changes to the
rust-lang/rust
repository's master branch is gatedon tests passing. - Documentation for how to use and how to build the platform is available.
target | std | host | notes |
---|---|---|---|
i686-pc-windows-gnu | ✓ | ✓ | 32-bit MinGW (Windows 7+) |
i686-pc-windows-msvc | ✓ | ✓ | 32-bit MSVC (Windows 7+) |
i686-unknown-linux-gnu | ✓ | ✓ | 32-bit Linux (kernel 2.6.32+, glibc 2.11+) |
x86_64-apple-darwin | ✓ | ✓ | 64-bit OSX (10.7+, Lion+) |
x86_64-pc-windows-gnu | ✓ | ✓ | 64-bit MinGW (Windows 7+) |
x86_64-pc-windows-msvc | ✓ | ✓ | 64-bit MSVC (Windows 7+) |
x86_64-unknown-linux-gnu | ✓ | ✓ | 64-bit Linux (kernel 2.6.32+, glibc 2.11+) |
Tier 2
Tier 2 platforms can be thought of as 'guaranteed to build'. Automated testsare not run so it's not guaranteed to produce a working build, but platformsoften work to quite a good degree and patches are always welcome!Specifically, these platforms are required to have each of the following:
- Official binary releases are provided for the platform.
- Automated building is set up, but may not be running tests.
- Landing changes to the
rust-lang/rust
repository's master branch is gated onplatforms building. For some platforms only the standard library iscompiled, but for othersrustc
andcargo
are too.
target | std | host | notes |
---|---|---|---|
aarch64-apple-ios | ✓ | ARM64 iOS | |
aarch64-fuchsia | ✓ | ARM64 Fuchsia | |
aarch64-linux-android | ✓ | ARM64 Android | |
aarch64-pc-windows-msvc | ✓ | ARM64 Windows MSVC | |
aarch64-unknown-linux-gnu | ✓ | ✓ | ARM64 Linux (kernel 4.2, glibc 2.17) |
aarch64-unknown-linux-musl | ✓ | ✓ | ARM64 Linux with MUSL |
aarch64-unknown-none | * | Bare ARM64, hardfloat | |
aarch64-unknown-none-softfloat | * | Bare ARM64, softfloat | |
arm-linux-androideabi | ✓ | ARMv7 Android | |
arm-unknown-linux-gnueabi | ✓ | ✓ | ARMv6 Linux (kernel 3.2, glibc 2.17) |
arm-unknown-linux-gnueabihf | ✓ | ✓ | ARMv6 Linux, hardfloat (kernel 3.2, glibc 2.17) |
arm-unknown-linux-musleabi | ✓ | ARMv6 Linux with MUSL | |
arm-unknown-linux-musleabihf | ✓ | ARMv6 Linux with MUSL, hardfloat | |
armebv7r-none-eabi | * | Bare ARMv7-R, Big Endian | |
armebv7r-none-eabihf | * | Bare ARMv7-R, Big Endian, hardfloat | |
armv5te-unknown-linux-gnueabi | ✓ | ARMv5TE Linux (kernel 4.4, glibc 2.23) | |
armv5te-unknown-linux-musleabi | ✓ | ARMv5TE Linux with MUSL | |
armv7-linux-androideabi | ✓ | ARMv7a Android | |
armv7a-none-eabi | * | Bare ARMv7-A | |
armv7r-none-eabi | * | Bare ARMv7-R | |
armv7r-none-eabihf | * | Bare ARMv7-R, hardfloat | |
armv7-unknown-linux-gnueabi | ✓ | ARMv7 Linux (kernel 4.15, glibc 2.27) | |
armv7-unknown-linux-gnueabihf | ✓ | ✓ | ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) |
armv7-unknown-linux-musleabi | ✓ | ARMv7 Linux, MUSL | |
armv7-unknown-linux-musleabihf | ✓ | ARMv7 Linux with MUSL | |
asmjs-unknown-emscripten | ✓ | asm.js via Emscripten | |
i586-pc-windows-msvc | ✓ | 32-bit Windows w/o SSE | |
i586-unknown-linux-gnu | ✓ | 32-bit Linux w/o SSE (kernel 4.4, glibc 2.23) | |
i586-unknown-linux-musl | ✓ | 32-bit Linux w/o SSE, MUSL | |
i686-linux-android | ✓ | 32-bit x86 Android | |
i686-unknown-freebsd | ✓ | ✓ | 32-bit FreeBSD |
i686-unknown-linux-musl | ✓ | 32-bit Linux with MUSL | |
mips-unknown-linux-gnu | ✓ | ✓ | MIPS Linux (kernel 4.4, glibc 2.23) |
mips-unknown-linux-musl | ✓ | MIPS Linux with MUSL | |
mips64-unknown-linux-gnuabi64 | ✓ | ✓ | MIPS64 Linux, n64 ABI (kernel 4.4, glibc 2.23) |
mips64-unknown-linux-muslabi64 | ✓ | MIPS64 Linux, n64 ABI, MUSL | |
mips64el-unknown-linux-gnuabi64 | ✓ | ✓ | MIPS64 (LE) Linux, n64 ABI (kernel 4.4, glibc 2.23) |
mips64el-unknown-linux-muslabi64 | ✓ | MIPS64 (LE) Linux, n64 ABI, MUSL | |
mipsel-unknown-linux-gnu | ✓ | ✓ | MIPS (LE) Linux (kernel 4.4, glibc 2.23) |
mipsel-unknown-linux-musl | ✓ | MIPS (LE) Linux with MUSL | |
nvptx64-nvidia-cuda | ✓ | --emit=asm generates PTX code that runs on NVIDIA GPUs | |
powerpc-unknown-linux-gnu | ✓ | ✓ | PowerPC Linux (kernel 2.6.32, glibc 2.11) |
powerpc64-unknown-linux-gnu | ✓ | ✓ | PPC64 Linux (kernel 2.6.32, glibc 2.11) |
powerpc64le-unknown-linux-gnu | ✓ | ✓ | PPC64LE Linux (kernel 3.10, glibc 2.17) |
riscv32i-unknown-none-elf | * | Bare RISC-V (RV32I ISA) | |
riscv32imac-unknown-none-elf | * | Bare RISC-V (RV32IMAC ISA) | |
riscv32imc-unknown-none-elf | * | Bare RISC-V (RV32IMC ISA) | |
riscv64gc-unknown-linux-gnu | ✓ | ✓ | RISC-V Linux (kernel 4.20, glibc 2.29) |
riscv64gc-unknown-none-elf | * | Bare RISC-V (RV64IMAFDC ISA) | |
riscv64imac-unknown-none-elf | * | Bare RISC-V (RV64IMAC ISA) | |
s390x-unknown-linux-gnu | ✓ | ✓ | S390x Linux (kernel 2.6.32, glibc 2.11) |
sparc64-unknown-linux-gnu | ✓ | SPARC Linux (kernel 4.4, glibc 2.23) | |
sparcv9-sun-solaris | ✓ | SPARC Solaris 10/11, illumos | |
thumbv6m-none-eabi | * | Bare Cortex-M0, M0+, M1 | |
thumbv7em-none-eabi | * | Bare Cortex-M4, M7 | |
thumbv7em-none-eabihf | * | Bare Cortex-M4F, M7F, FPU, hardfloat | |
thumbv7m-none-eabi | * | Bare Cortex-M3 | |
thumbv7neon-linux-androideabi | ✓ | Thumb2-mode ARMv7a Android with NEON | |
thumbv7neon-unknown-linux-gnueabihf | ✓ | Thumb2-mode ARMv7a Linux with NEON (kernel 4.4, glibc 2.23) | |
thumbv8m.base-none-eabi | * | ARMv8-M Baseline | |
thumbv8m.main-none-eabi | * | ARMv8-M Mainline | |
thumbv8m.main-none-eabihf | * | ARMv8-M Mainline, hardfloat | |
wasm32-unknown-emscripten | ✓ | WebAssembly via Emscripten | |
wasm32-unknown-unknown | ✓ | WebAssembly | |
wasm32-wasi | ✓ | WebAssembly with WASI | |
x86_64-apple-ios | ✓ | 64-bit x86 iOS | |
x86_64-fortanix-unknown-sgx | ✓ | Fortanix ABI for 64-bit Intel SGX | |
x86_64-fuchsia | ✓ | 64-bit Fuchsia | |
x86_64-linux-android | ✓ | 64-bit x86 Android | |
x86_64-rumprun-netbsd | ✓ | 64-bit NetBSD Rump Kernel | |
x86_64-sun-solaris | ✓ | 64-bit Solaris 10/11, illumos | |
x86_64-unknown-freebsd | ✓ | ✓ | 64-bit FreeBSD |
x86_64-unknown-illumos | ✓ | ✓ | illumos |
x86_64-unknown-linux-gnux32 | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27) | |
x86_64-unknown-linux-musl | ✓ | ✓ | 64-bit Linux with MUSL |
x86_64-unknown-netbsd | ✓ | ✓ | NetBSD/amd64 |
x86_64-unknown-redox | ✓ | Redox OS |
Rust For Mac Os High Sierra
Tier 3
Install Rust Mac
Tier 3 platforms are those which the Rust codebase has support for, but whichare not built or tested automatically, and may not work. Official builds arenot available.
Rust Macos Gui
target | std | host | notes |
---|---|---|---|
aarch64-apple-darwin | ? | ARM64 macOS | |
aarch64-apple-tvos | * | ARM64 tvOS | |
aarch64-unknown-cloudabi | ✓ | ARM64 CloudABI | |
aarch64-unknown-freebsd | ✓ | ✓ | ARM64 FreeBSD |
aarch64-unknown-hermit | ? | ||
aarch64-unknown-netbsd | ? | ||
aarch64-unknown-openbsd | ✓ | ✓ | ARM64 OpenBSD |
aarch64-unknown-redox | ? | ARM64 Redox OS | |
aarch64-uwp-windows-msvc | ? | ||
aarch64-wrs-vxworks | ? | ||
armv4t-unknown-linux-gnueabi | ? | ||
armv6-unknown-freebsd | ✓ | ✓ | ARMv6 FreeBSD |
armv6-unknown-netbsd-eabihf | ? | ||
armv7-apple-ios | ✓ | ARMv7 iOS, Cortex-a8 | |
armv7-unknown-cloudabi-eabihf | ✓ | ARMv7 CloudABI, hardfloat | |
armv7-unknown-freebsd | ✓ | ✓ | ARMv7 FreeBSD |
armv7-unknown-netbsd-eabihf | ? | ||
armv7-wrs-vxworks-eabihf | ? | ||
armv7a-none-eabihf | * | ARM Cortex-A, hardfloat | |
armv7s-apple-ios | ✓ | ||
avr-unknown-gnu-atmega328 | ✗ | AVR. Requires -Z build-std=core | |
hexagon-unknown-linux-musl | ? | ||
i386-apple-ios | ✓ | 32-bit x86 iOS | |
i686-apple-darwin | ✓ | ✓ | 32-bit OSX (10.7+, Lion+) |
i686-pc-windows-msvc | ✓ | 32-bit Windows XP support | |
i686-unknown-cloudabi | ✓ | 32-bit CloudABI | |
i686-unknown-uefi | ? | 32-bit UEFI | |
i686-unknown-haiku | ✓ | ✓ | 32-bit Haiku |
i686-unknown-netbsd | ✓ | NetBSD/i386 with SSE2 | |
i686-unknown-openbsd | ✓ | ✓ | 32-bit OpenBSD |
i686-uwp-windows-gnu | ? | ||
i686-uwp-windows-msvc | ? | ||
i686-wrs-vxworks | ? | ||
mips-unknown-linux-uclibc | ✓ | MIPS Linux with uClibc | |
mipsel-unknown-linux-uclibc | ✓ | MIPS (LE) Linux with uClibc | |
mipsel-sony-psp | * | MIPS (LE) Sony PlayStation Portable (PSP) | |
mipsisa32r6-unknown-linux-gnu | ? | ||
mipsisa32r6el-unknown-linux-gnu | ? | ||
mipsisa64r6-unknown-linux-gnuabi64 | ? | ||
mipsisa64r6el-unknown-linux-gnuabi64 | ? | ||
msp430-none-elf | * | 16-bit MSP430 microcontrollers | |
powerpc-unknown-linux-gnuspe | ✓ | PowerPC SPE Linux | |
powerpc-unknown-linux-musl | ? | ||
powerpc-unknown-netbsd | ? | ||
powerpc-wrs-vxworks | ? | ||
powerpc-wrs-vxworks-spe | ? | ||
powerpc64-unknown-freebsd | ✓ | ✓ | PPC64 FreeBSD (ELFv1 and ELFv2) |
powerpc64-unknown-linux-musl | ? | ||
powerpc64-wrs-vxworks | ? | ||
powerpc64le-unknown-linux-musl | ? | ||
riscv32gc-unknown-linux-gnu | RISC-V Linux (kernel 5.4, glibc 2.33) | ||
sparc-unknown-linux-gnu | ✓ | 32-bit SPARC Linux | |
sparc64-unknown-netbsd | ✓ | ✓ | NetBSD/sparc64 |
sparc64-unknown-openbsd | ? | ||
thumbv7a-pc-windows-msvc | ? | ||
thumbv7a-uwp-windows-msvc | ✓ | ||
thumbv7neon-unknown-linux-musleabihf | ? | Thumb2-mode ARMv7a Linux with NEON, MUSL | |
thumbv4t-none-eabi | * | ARMv4T T32 | |
x86_64-apple-ios-macabi | ✓ | Apple Catalyst | |
x86_64-apple-tvos | * | x86 64-bit tvOS | |
x86_64-linux-kernel | * | Linux kernel modules | |
x86_64-pc-solaris | ? | ||
x86_64-pc-windows-msvc | ✓ | 64-bit Windows XP support | |
x86_64-unknown-cloudabi | ✓ | 64-bit CloudABI | |
x86_64-unknown-dragonfly | ✓ | ✓ | 64-bit DragonFlyBSD |
x86_64-unknown-haiku | ✓ | ✓ | 64-bit Haiku |
x86_64-unknown-hermit | ? | ||
x86_64-unknown-hermit-kernel | ? | HermitCore kernel | |
x86_64-unknown-l4re-uclibc | ? | ||
x86_64-unknown-openbsd | ✓ | ✓ | 64-bit OpenBSD |
x86_64-unknown-uefi | ? | ||
x86_64-uwp-windows-gnu | ✓ | ||
x86_64-uwp-windows-msvc | ✓ | ||
x86_64-wrs-vxworks | ? |