Rollup merge of #103933 - nicholasbishop:bishop-uefi-tier-2, r=JohnTitor

Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2

MCP: https://github.com/rust-lang/compiler-team/issues/555

CC `@dvdhrm`
This commit is contained in:
Dylan DPC 2022-11-09 19:21:23 +05:30 committed by GitHub
commit 2313d32c36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 33 deletions

View file

@ -118,6 +118,9 @@ ENV TARGETS=$TARGETS,armv7-unknown-linux-gnueabi
ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabi ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabi
ENV TARGETS=$TARGETS,i686-unknown-freebsd ENV TARGETS=$TARGETS,i686-unknown-freebsd
ENV TARGETS=$TARGETS,x86_64-unknown-none ENV TARGETS=$TARGETS,x86_64-unknown-none
ENV TARGETS=$TARGETS,aarch64-unknown-uefi
ENV TARGETS=$TARGETS,i686-unknown-uefi
ENV TARGETS=$TARGETS,x86_64-unknown-uefi
# As per https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1300211 # 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 # we need asm in the search path for gcc-8 (for gnux32) but not in the search path of the

View file

@ -128,6 +128,7 @@ target | std | notes
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android [`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat `aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
`aarch64-unknown-none` | * | Bare ARM64, hardfloat `aarch64-unknown-none` | * | Bare ARM64, hardfloat
[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | * | ARM64 UEFI
[`arm-linux-androideabi`](platform-support/android.md) | ✓ | ARMv7 Android [`arm-linux-androideabi`](platform-support/android.md) | ✓ | ARMv7 Android
`arm-unknown-linux-musleabi` | ✓ | ARMv6 Linux with MUSL `arm-unknown-linux-musleabi` | ✓ | ARMv6 Linux with MUSL
`arm-unknown-linux-musleabihf` | ✓ | ARMv6 Linux with MUSL, hardfloat `arm-unknown-linux-musleabihf` | ✓ | ARMv6 Linux with MUSL, hardfloat
@ -149,6 +150,7 @@ target | std | notes
[`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android [`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android
`i686-unknown-freebsd` | ✓ | 32-bit FreeBSD `i686-unknown-freebsd` | ✓ | 32-bit FreeBSD
`i686-unknown-linux-musl` | ✓ | 32-bit Linux with MUSL `i686-unknown-linux-musl` | ✓ | 32-bit Linux with MUSL
[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | * | 32-bit UEFI
`mips-unknown-linux-musl` | ✓ | MIPS Linux with MUSL `mips-unknown-linux-musl` | ✓ | MIPS Linux with MUSL
`mips64-unknown-linux-muslabi64` | ✓ | MIPS64 Linux, n64 ABI, MUSL `mips64-unknown-linux-muslabi64` | ✓ | MIPS64 Linux, n64 ABI, MUSL
`mips64el-unknown-linux-muslabi64` | ✓ | MIPS64 (LE) Linux, n64 ABI, MUSL `mips64el-unknown-linux-muslabi64` | ✓ | MIPS64 (LE) Linux, n64 ABI, MUSL
@ -181,6 +183,7 @@ target | std | notes
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27) `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-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat
`x86_64-unknown-redox` | ✓ | Redox OS `x86_64-unknown-redox` | ✓ | Redox OS
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | * | 64-bit UEFI
[Fortanix ABI]: https://edp.fortanix.com/ [Fortanix ABI]: https://edp.fortanix.com/
@ -213,7 +216,6 @@ target | std | host | notes
[`aarch64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ | [`aarch64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
`aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD `aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD
`aarch64-unknown-hermit` | ✓ | | ARM64 HermitCore `aarch64-unknown-hermit` | ✓ | | ARM64 HermitCore
[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | * | | ARM64 UEFI
`aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI) `aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI)
`aarch64-unknown-netbsd` | ✓ | ✓ | `aarch64-unknown-netbsd` | ✓ | ✓ |
[`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD [`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD
@ -252,7 +254,6 @@ target | std | host | notes
`i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku `i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku
`i686-unknown-netbsd` | ✓ | ✓ | NetBSD/i386 with SSE2 `i686-unknown-netbsd` | ✓ | ✓ | NetBSD/i386 with SSE2
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD [`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD
[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | * | | 32-bit UEFI
`i686-uwp-windows-gnu` | ? | | `i686-uwp-windows-gnu` | ? | |
`i686-uwp-windows-msvc` | ? | | `i686-uwp-windows-msvc` | ? | |
`i686-wrs-vxworks` | ? | | `i686-wrs-vxworks` | ? | |
@ -311,7 +312,6 @@ target | std | host | notes
`x86_64-unknown-l4re-uclibc` | ? | | `x86_64-unknown-l4re-uclibc` | ? | |
`x86_64-unknown-none-linuxkernel` | * | | Linux kernel modules `x86_64-unknown-none-linuxkernel` | * | | Linux kernel modules
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD [`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | * | | 64-bit UEFI
`x86_64-uwp-windows-gnu` | ✓ | | `x86_64-uwp-windows-gnu` | ✓ | |
`x86_64-uwp-windows-msvc` | ✓ | | `x86_64-uwp-windows-msvc` | ✓ | |
`x86_64-wrs-vxworks` | ? | | `x86_64-wrs-vxworks` | ? | |

View file

@ -1,6 +1,6 @@
# `*-unknown-uefi` # `*-unknown-uefi`
**Tier: 3** **Tier: 2**
Unified Extensible Firmware Interface (UEFI) targets for application, driver, Unified Extensible Firmware Interface (UEFI) targets for application, driver,
and core UEFI binaries. and core UEFI binaries.
@ -72,28 +72,14 @@ target = ["x86_64-unknown-uefi"]
## Building Rust programs ## Building Rust programs
Rust does not yet ship pre-compiled artifacts for this target. To compile for Starting with Rust 1.67, precompiled artifacts are provided via
this target, you will either need to build Rust with the target enabled (see `rustup`. For example, to use `x86_64-unknown-uefi`:
"Building rust for UEFI targets" above), or build your own copy of `core` by
using `build-std`, `cargo-buildx`, or similar.
A native build with the unstable `build-std`-feature can be achieved via:
```sh ```sh
cargo +nightly build \ # install cross-compile toolchain
-Zbuild-std=core,compiler_builtins \ rustup target add x86_64-unknown-uefi
-Zbuild-std-features=compiler-builtins-mem \ # target flag may be used with any cargo or rustc command
--target x86_64-unknown-uefi cargo build --target x86_64-unknown-uefi
```
Alternatively, you can install `cargo-xbuild` via
`cargo install --force cargo-xbuild` and build for the UEFI targets via:
```sh
cargo \
+nightly \
xbuild \
--target x86_64-unknown-uefi
``` ```
## Testing ## Testing
@ -167,18 +153,10 @@ The following code is a valid UEFI application returning immediately upon
execution with an exit code of 0. A panic handler is provided. This is executed execution with an exit code of 0. A panic handler is provided. This is executed
by rust on panic. For simplicity, we simply end up in an infinite loop. by rust on panic. For simplicity, we simply end up in an infinite loop.
Note that as of rust-1.31.0, all features used here are stabilized. No unstable
features are required, nor do we rely on nightly compilers. However, if you do
not compile rustc for the UEFI targets, you need a nightly compiler to support
the `-Z build-std` flag.
This example can be compiled as binary crate via `cargo`: This example can be compiled as binary crate via `cargo`:
```sh ```sh
cargo +nightly build \ cargo build --target x86_64-unknown-uefi
-Zbuild-std=core,compiler_builtins \
-Zbuild-std-features=compiler-builtins-mem \
--target x86_64-unknown-uefi
``` ```
```rust,ignore (platform-specific,eh-personality-is-unstable) ```rust,ignore (platform-specific,eh-personality-is-unstable)

View file

@ -60,6 +60,7 @@ static TARGETS: &[&str] = &[
"aarch64-unknown-none", "aarch64-unknown-none",
"aarch64-unknown-none-softfloat", "aarch64-unknown-none-softfloat",
"aarch64-unknown-redox", "aarch64-unknown-redox",
"aarch64-unknown-uefi",
"arm-linux-androideabi", "arm-linux-androideabi",
"arm-unknown-linux-gnueabi", "arm-unknown-linux-gnueabi",
"arm-unknown-linux-gnueabihf", "arm-unknown-linux-gnueabihf",
@ -95,6 +96,7 @@ static TARGETS: &[&str] = &[
"i686-unknown-freebsd", "i686-unknown-freebsd",
"i686-unknown-linux-gnu", "i686-unknown-linux-gnu",
"i686-unknown-linux-musl", "i686-unknown-linux-musl",
"i686-unknown-uefi",
"m68k-unknown-linux-gnu", "m68k-unknown-linux-gnu",
"mips-unknown-linux-gnu", "mips-unknown-linux-gnu",
"mips-unknown-linux-musl", "mips-unknown-linux-musl",
@ -151,6 +153,7 @@ static TARGETS: &[&str] = &[
"x86_64-unknown-none", "x86_64-unknown-none",
"x86_64-unknown-redox", "x86_64-unknown-redox",
"x86_64-unknown-hermit", "x86_64-unknown-hermit",
"x86_64-unknown-uefi",
]; ];
/// This allows the manifest to contain rust-docs for hosts that don't build /// This allows the manifest to contain rust-docs for hosts that don't build