Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote x86_64-unknown-none target to Tier 2 and distribute build artifacts #95705

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ci/docker/host-x86_64/dist-various-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda
ENV TARGETS=$TARGETS,armv7-unknown-linux-gnueabi
ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabi
ENV TARGETS=$TARGETS,i686-unknown-freebsd
ENV TARGETS=$TARGETS,x86_64-unknown-none

# As per https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1300211
# we need asm in the search path for gcc-8 (for gnux32) but not in the search path of the
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ target | std | notes
`x86_64-linux-android` | ✓ | 64-bit x86 Android
`x86_64-pc-solaris` | ✓ | 64-bit Solaris 10/11, illumos
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)
[`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat
`x86_64-unknown-redox` | ✓ | Redox OS

[Fortanix ABI]: https://edp.fortanix.com/
Expand Down Expand Up @@ -291,7 +292,6 @@ target | std | host | notes
`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku
`x86_64-unknown-hermit` | ✓ | | HermitCore
`x86_64-unknown-l4re-uclibc` | ? | |
[`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | | Freestanding/bare-metal x86_64, softfloat
`x86_64-unknown-none-linuxkernel` | * | | Linux kernel modules
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
`x86_64-unknown-uefi` | * | | 64-bit UEFI
Expand Down
18 changes: 11 additions & 7 deletions src/doc/rustc/src/platform-support/x86_64-unknown-none.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `x86_64-unknown-none`

**Tier: 3**
**Tier: 2**

Freestanding/bare-metal x86-64 binaries in ELF format: firmware, kernels, etc.

Expand Down Expand Up @@ -32,7 +32,7 @@ You can change this using the `-C code-model=` option to rustc.
On `x86_64-unknown-none`, `extern "C"` uses the [standard System V calling
convention](https://gitlab.com/x86-psABIs/x86-64-ABI), without red zones.

This target generated binaries in the ELF format. Any alternate formats or
This target generates binaries in the ELF format. Any alternate formats or
special considerations for binary layout will require linker options or linker
scripts.

Expand All @@ -49,15 +49,19 @@ target = ["x86_64-unknown-none"]

## Building Rust programs

Rust does not yet ship pre-compiled artifacts for this target. To compile for
this target, you will either need to build Rust with the target enabled (see
"Building the target" above), or build your own copy of `core` by using
`build-std` or similar.
Starting with Rust 1.62, precompiled artifacts are provided via `rustup`:

```text
# install cross-compile toolchain
rustup target add x86_64-unknown-none
# target flag may be used with any cargo or rustc command
cargo build --target x86_64-unknown-none
```

## Testing

As `x86_64-unknown-none` supports a variety of different environments and does
not support `std`, this target does not support running the Rust testsuite.
not support `std`, this target does not support running the Rust test suite.

## Cross-compilation toolchains and C code

Expand Down
1 change: 1 addition & 0 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static TARGETS: &[&str] = &[
"x86_64-unknown-linux-gnux32",
"x86_64-unknown-linux-musl",
"x86_64-unknown-netbsd",
"x86_64-unknown-none",
"x86_64-unknown-redox",
"x86_64-unknown-hermit",
];
Expand Down