diff --git a/.cargo/config b/.cargo/config index 4be91559e..422bf9d2a 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,2 +1,3 @@ [unstable] build-std = ["core", "compiler_builtins", "alloc"] +build-std-features = ["compiler-builtins-mem"] diff --git a/BUILDING.md b/BUILDING.md index 6f659b4bd..17a23bcc6 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -22,9 +22,8 @@ application. Copy it to a new directory to get started. ## Building and running -- Build using a `nightly` version of the compiler and activate the - [`build-std`](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) - Cargo feature: `cargo +nightly build -Z build-std --target x86_64-unknown-uefi`. +- Build using a `nightly` version of the compiler: + `cargo +nightly build --target x86_64-unknown-uefi`. - The `target` directory will contain a `x86_64-unknown-uefi` subdirectory, where you will find the `uefi_app.efi` file - a normal UEFI executable. diff --git a/template/.cargo/config b/template/.cargo/config index 4be91559e..422bf9d2a 100644 --- a/template/.cargo/config +++ b/template/.cargo/config @@ -1,2 +1,3 @@ [unstable] build-std = ["core", "compiler_builtins", "alloc"] +build-std-features = ["compiler-builtins-mem"] diff --git a/template/Cargo.toml b/template/Cargo.toml index 774a18497..8f14c1083 100644 --- a/template/Cargo.toml +++ b/template/Cargo.toml @@ -4,8 +4,6 @@ version = "0.1.0" edition = "2018" [dependencies] -rlibc = "1.0.0" - # In a real application, change these to point to the latest release # on crates.io. uefi = { path = "..", features = ["exts"] } diff --git a/template/src/main.rs b/template/src/main.rs index 721fc0342..3fc3475e3 100644 --- a/template/src/main.rs +++ b/template/src/main.rs @@ -2,8 +2,6 @@ #![no_std] #![feature(abi_efiapi)] -extern crate rlibc; - use uefi::prelude::*; use uefi::ResultExt; diff --git a/uefi-test-runner/Cargo.toml b/uefi-test-runner/Cargo.toml index de369fbb9..67b5e2913 100644 --- a/uefi-test-runner/Cargo.toml +++ b/uefi-test-runner/Cargo.toml @@ -11,10 +11,6 @@ uefi-services = { path = "../uefi-services" } log = { version = "0.4.11", default-features = false } -# When building using Cargo's `build-std` feature, the `mem` feature of `compiler-builtins` -# does not automatically get enabled. Therefore, we have to manually add support for -# the memory functions. -rlibc = "1.0.0" qemu-exit = "2.0.0" [features] diff --git a/uefi-test-runner/src/main.rs b/uefi-test-runner/src/main.rs index 098e6ddea..50d57a8a5 100644 --- a/uefi-test-runner/src/main.rs +++ b/uefi-test-runner/src/main.rs @@ -8,9 +8,6 @@ extern crate log; #[macro_use] extern crate alloc; -// Keep this line to ensure the `mem*` functions are linked in. -extern crate rlibc; - use alloc::string::String; use core::mem; use uefi::prelude::*;