Skip to content

Commit 78898f0

Browse files
committed
Format files
1 parent 0c8fb9f commit 78898f0

File tree

3 files changed

+171
-90
lines changed

3 files changed

+171
-90
lines changed

src/compiler-support.md

Lines changed: 57 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# A note on compiler support
22

33
This book makes use of a built-in *compiler* target, the `thumbv7m-none-eabi`, for which the Rust
4-
team distributes a `rust-std` component, which is a pre-compiled collection of crates like [`core`] and [`std`].
4+
team distributes a `rust-std` component, which is a pre-compiled collection of crates like [`core`]
5+
and [`std`].
56

67
[`core`]: https://doc.rust-lang.org/core/index.html
78
[`std`]: https://doc.rust-lang.org/std/index.html
89

9-
If you want to attempt replicating the contents of this book for a different target architecture, you
10-
need to take into account the different levels of support that Rust provides for (compilation)
10+
If you want to attempt replicating the contents of this book for a different target architecture,
11+
you need to take into account the different levels of support that Rust provides for (compilation)
1112
targets.
1213

1314
## LLVM support
@@ -64,7 +65,8 @@ changes.
6465

6566
On the other hand, if LLVM doesn't support the architecture, but a fork of LLVM does, you will have
6667
to replace the original version of LLVM with the fork before building `rustc`. The Rust build system
67-
allows this and in principle it should just require changing the `llvm` submodule to point to the fork.
68+
allows this and in principle it should just require changing the `llvm` submodule to point to the
69+
fork.
6870

6971
If your target architecture is only supported by some vendor provided GCC, you have the option of
7072
using [`mrustc`], an unofficial Rust compiler, to translate your Rust program into C code and then
@@ -75,13 +77,13 @@ compile that using GCC.
7577
## Built-in target
7678

7779
A compilation target is more than just its architecture. Each target has a [specification]
78-
associated to it that describes, among other things, its architecture, its operating system
79-
and the default linker.
80+
associated to it that describes, among other things, its architecture, its operating system and the
81+
default linker.
8082

8183
[specification]: https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md
8284

83-
The Rust compiler knows about several targets. These are *built into* the compiler and
84-
can be listed by running the following command:
85+
The Rust compiler knows about several targets. These are *built into* the compiler and can be listed
86+
by running the following command:
8587

8688
``` console
8789
$ rustc --print target-list | column
@@ -200,50 +202,61 @@ custom target by writing your own target specification file in JSON format which
200202
## `rust-std` component
201203

202204
For some of the built-in target the Rust team distributes `rust-std` components via `rustup`. This
203-
component is a collection of pre-compiled crates like `core` and `std`, and it's required for
204-
cross compilation.
205+
component is a collection of pre-compiled crates like `core` and `std`, and it's required for cross
206+
compilation.
205207

206208
You can find the list of targets that have a `rust-std` component available via `rustup` by running
207209
the following command:
208210

209211
``` console
210212
$ rustup target list | column
211-
aarch64-apple-ios mips64-unknown-linux-gnuabi64
212-
aarch64-linux-android mips64el-unknown-linux-gnuabi64
213-
aarch64-unknown-fuchsia mipsel-unknown-linux-gnu
214-
aarch64-unknown-linux-gnu mipsel-unknown-linux-musl
215-
aarch64-unknown-linux-musl powerpc-unknown-linux-gnu
216-
arm-linux-androideabi powerpc64-unknown-linux-gnu
217-
arm-unknown-linux-gnueabi powerpc64le-unknown-linux-gnu
218-
arm-unknown-linux-gnueabihf s390x-unknown-linux-gnu
219-
arm-unknown-linux-musleabi sparc64-unknown-linux-gnu
220-
arm-unknown-linux-musleabihf sparcv9-sun-solaris
221-
armv5te-unknown-linux-gnueabi thumbv6m-none-eabi
222-
armv5te-unknown-linux-musleabi thumbv7em-none-eabi
223-
armv7-apple-ios thumbv7em-none-eabihf
213+
aarch64-apple-ios mipsel-unknown-linux-musl
214+
aarch64-fuchsia nvptx64-nvidia-cuda
215+
aarch64-linux-android powerpc-unknown-linux-gnu
216+
aarch64-pc-windows-msvc powerpc64-unknown-linux-gnu
217+
aarch64-unknown-linux-gnu powerpc64le-unknown-linux-gnu
218+
aarch64-unknown-linux-musl riscv32i-unknown-none-elf
219+
aarch64-unknown-none riscv32imac-unknown-none-elf
220+
aarch64-unknown-none-softfloat riscv32imc-unknown-none-elf
221+
arm-linux-androideabi riscv64gc-unknown-linux-gnu
222+
arm-unknown-linux-gnueabi riscv64gc-unknown-none-elf
223+
arm-unknown-linux-gnueabihf riscv64imac-unknown-none-elf
224+
arm-unknown-linux-musleabi s390x-unknown-linux-gnu
225+
arm-unknown-linux-musleabihf sparc64-unknown-linux-gnu
226+
armebv7r-none-eabi sparcv9-sun-solaris
227+
armebv7r-none-eabihf thumbv6m-none-eabi
228+
armv5te-unknown-linux-gnueabi thumbv7em-none-eabi
229+
armv5te-unknown-linux-musleabi thumbv7em-none-eabihf
224230
armv7-linux-androideabi thumbv7m-none-eabi
225-
armv7-unknown-linux-gnueabihf wasm32-unknown-emscripten
226-
armv7-unknown-linux-musleabihf wasm32-unknown-unknown
227-
armv7s-apple-ios x86_64-apple-darwin
228-
asmjs-unknown-emscripten x86_64-apple-ios
229-
i386-apple-ios x86_64-linux-android
230-
i586-pc-windows-msvc x86_64-pc-windows-gnu
231-
i586-unknown-linux-gnu x86_64-pc-windows-msvc
232-
i586-unknown-linux-musl x86_64-rumprun-netbsd
233-
i686-apple-darwin x86_64-sun-solaris
234-
i686-linux-android x86_64-unknown-cloudabi
235-
i686-pc-windows-gnu x86_64-unknown-freebsd
236-
i686-pc-windows-msvc x86_64-unknown-fuchsia
237-
i686-unknown-freebsd x86_64-unknown-linux-gnu (default)
238-
i686-unknown-linux-gnu x86_64-unknown-linux-gnux32
239-
i686-unknown-linux-musl x86_64-unknown-linux-musl
240-
mips-unknown-linux-gnu x86_64-unknown-netbsd
241-
mips-unknown-linux-musl x86_64-unknown-redox
231+
armv7-unknown-linux-gnueabi thumbv7neon-linux-androideabi
232+
armv7-unknown-linux-gnueabihf thumbv7neon-unknown-linux-gnueabihf
233+
armv7-unknown-linux-musleabi thumbv8m.base-none-eabi
234+
armv7-unknown-linux-musleabihf thumbv8m.main-none-eabi
235+
armv7a-none-eabi thumbv8m.main-none-eabihf
236+
armv7r-none-eabi wasm32-unknown-emscripten
237+
armv7r-none-eabihf wasm32-unknown-unknown
238+
asmjs-unknown-emscripten wasm32-wasi
239+
i586-pc-windows-msvc x86_64-apple-darwin
240+
i586-unknown-linux-gnu x86_64-apple-ios
241+
i586-unknown-linux-musl x86_64-fortanix-unknown-sgx
242+
i686-linux-android x86_64-fuchsia
243+
i686-pc-windows-gnu x86_64-linux-android
244+
i686-pc-windows-msvc x86_64-pc-windows-gnu
245+
i686-unknown-freebsd x86_64-pc-windows-msvc
246+
i686-unknown-linux-gnu x86_64-rumprun-netbsd
247+
i686-unknown-linux-musl x86_64-sun-solaris
248+
mips-unknown-linux-gnu x86_64-unknown-cloudabi
249+
mips-unknown-linux-musl x86_64-unknown-freebsd
250+
mips64-unknown-linux-gnuabi64 x86_64-unknown-linux-gnu (default)
251+
mips64-unknown-linux-muslabi64 x86_64-unknown-linux-gnux32
252+
mips64el-unknown-linux-gnuabi64 x86_64-unknown-linux-musl
253+
mips64el-unknown-linux-muslabi64 x86_64-unknown-netbsd
254+
mipsel-unknown-linux-gnu x86_64-unknown-redox
242255
```
243256

244-
If there's no `rust-std` component for your target or you are using a custom target, then you'll have
245-
to use a nightly toolchain to build the standard library. See the next page about [building for custom targets][use-target-file].
257+
If there's no `rust-std` component for your target, or you are using a custom target, then you'll
258+
have to use a nightly toolchain to build the standard library. See the next page about [building for
259+
custom targets][use-target-file].
246260

247261
[use-target-file]: ./custom-target.md#use-the-target-file
248-
249-
[Xargo]: https://github.com/japaric/xargo
262+
[xargo]: https://github.com/japaric/xargo

0 commit comments

Comments
 (0)