Skip to content

Use build-std-features instead of rlibc #298

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

Merged
merged 3 commits into from
Oct 18, 2021
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 .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[unstable]
build-std = ["core", "compiler_builtins", "alloc"]
build-std-features = ["compiler-builtins-mem"]
5 changes: 2 additions & 3 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions template/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[unstable]
build-std = ["core", "compiler_builtins", "alloc"]
build-std-features = ["compiler-builtins-mem"]
2 changes: 0 additions & 2 deletions template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 0 additions & 2 deletions template/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#![no_std]
#![feature(abi_efiapi)]

extern crate rlibc;

use uefi::prelude::*;
use uefi::ResultExt;

Expand Down
4 changes: 0 additions & 4 deletions uefi-test-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 0 additions & 3 deletions uefi-test-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down